From 789bc64b4c15d19cd11d6c1bfe2f7de15289eba5 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Tue, 27 Nov 2012 19:32:50 -0800 Subject: [PATCH] make an executable that runs all the tests in preparation for making possibly-breaking changes Ignore-this: 9fcdf4cbef8c48ab63cf8852f7c34609 darcs-hash:20121128033250-76d51-fec2cd876579663f85d3b23a9bcf2dc6a469ce94 --- tests/Main.hs | 18 ++++++++++++++++++ tests/Test/Tester.hs | 3 --- 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 tests/Main.hs diff --git a/tests/Main.hs b/tests/Main.hs new file mode 100644 index 0000000..0b14f1c --- /dev/null +++ b/tests/Main.hs @@ -0,0 +1,18 @@ +import Control.Monad +import Test.HUnit +import Test.Tests + +hunitTests = + [ ("utf8Tests", utf8Tests) + , ("utf16Tests", utf16Tests) + , ("punycodeTests", punycodeTests) + , ("isoTests", isoTests) + , ("jisTests", jisTests) + , ("gb18030Tests", gb18030Tests) + ] + +main = do + identityTests + forM_ hunitTests $ \(name, test) -> do + putStrLn $ "running " ++ name + runTestTT test >>= print diff --git a/tests/Test/Tester.hs b/tests/Test/Tester.hs index cd4e18c..8dbc85d 100644 --- a/tests/Test/Tester.hs +++ b/tests/Test/Tester.hs @@ -53,9 +53,6 @@ charGen = let threeByte = choose (0x010000,0x10FFFF) >>= return.chr in frequency [(40,ascii),(30,oneByte),(20,twoByte),(10,threeByte)] -instance Arbitrary Word8 where - arbitrary = choose (0x00,0xFF::Int) >>= return.fromIntegral - quickCheckEncoding :: Encoding enc => enc -> IO () quickCheckEncoding e = do quickCheck (encodingIdentity e)