make an executable that runs all the tests in preparation for making possibly-breaking changes

Ignore-this: 9fcdf4cbef8c48ab63cf8852f7c34609

darcs-hash:20121128033250-76d51-fec2cd876579663f85d3b23a9bcf2dc6a469ce94
This commit is contained in:
Daniel Wagner 2012-11-27 19:32:50 -08:00
parent 93da077efb
commit 789bc64b4c
2 changed files with 18 additions and 3 deletions

18
tests/Main.hs Normal file
View File

@ -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

View File

@ -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)