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