@@ -4,8 +4,8 @@ module Tests.Properties.Mul (tests) where
5import Control.Applicative ((<$>), pure)
5import Control.Applicative ((<$>), pure)
6import Control.Exception as E (SomeException, catch, evaluate)
6import Control.Exception as E (SomeException, catch, evaluate)
7−import Data.Int (Int64)
7+import Data.Int (Int32, Int64)
8−import Data.Text.Internal (mul, mul64)
8+import Data.Text.Internal (mul, mul32, mul64)
9import System.IO.Unsafe (unsafePerformIO)
9import System.IO.Unsafe (unsafePerformIO)
10import Test.Framework (Test)
10import Test.Framework (Test)
11import Test.Framework.Providers.QuickCheck2 (testProperty)
11import Test.Framework.Providers.QuickCheck2 (testProperty)
@@ -23,6 +23,9 @@ eval :: (a -> b -> c) -> a -> b -> Maybe c
23eval f a b = unsafePerformIO $
23eval f a b = unsafePerformIO $
24 (Just <$> evaluate (f a b)) `E.catch` (\(_::SomeException) -> pure Nothing)
24 (Just <$> evaluate (f a b)) `E.catch` (\(_::SomeException) -> pure Nothing)
26+t_mul32 :: Int32 -> Int32 -> Property
27+t_mul32 a b = mulRef a b === eval mul32 a b
26t_mul64 :: Int64 -> Int64 -> Property
29t_mul64 :: Int64 -> Int64 -> Property
27t_mul64 a b = mulRef a b === eval mul64 a b
30t_mul64 a b = mulRef a b === eval mul64 a b
@@ -32,5 +35,6 @@ t_mul a b = mulRef a b === eval mul a b
32tests :: [Test]
35tests :: [Test]
34 testProperty "t_mul" t_mul
37 testProperty "t_mul" t_mul
38+ , testProperty "t_mul32" t_mul32
35 , testProperty "t_mul64" t_mul64
39 , testProperty "t_mul64" t_mul64