Remove debugging putStr from the QC-HUnit adaptor.

This was what was causing random numbers to appear during testing.

I've also cleaned up the code a bit.
This commit is contained in:
Adam Sampson 2008-04-08 14:39:43 +00:00
parent 9e9459cb4a
commit e460032c30

View File

@ -92,21 +92,17 @@ testCheck config property =
tests :: Config -> Gen Result -> StdGen -> Int -> Int -> [[String]] -> IO ()
tests config gen rnd0 ntest nfail stamps
| ntest == configMaxTest config = return ()
| nfail == configMaxFail config =
assertFailure $ "Arguments exhausted after " ++ show ntest ++ " tests"
| otherwise =
do putStr (configEvery config ntest (arguments result))
case ok result of
Nothing ->
tests config gen rnd1 ntest (nfail+1) stamps
Just True ->
tests config gen rnd1 (ntest+1) nfail (stamp result:stamps)
Just False ->
assertFailure $ ( "Falsifiable, after "
++ show ntest
++ " tests:\n"
++ unlines (arguments result)
)
| nfail == configMaxFail config
= assertFailure $ "Arguments exhausted after " ++ show ntest ++ " tests"
| otherwise
= case ok result of
Nothing ->
tests config gen rnd1 ntest (nfail+1) stamps
Just True ->
tests config gen rnd1 (ntest+1) nfail (stamp result:stamps)
Just False ->
assertFailure $ "Falsifiable, after " ++ show ntest
++ " tests:\n" ++ unlines (arguments result)
where
result = generate (configSize config ntest) rnd2 gen
(rnd1,rnd2) = split rnd0