From e460032c30ffe84d4779b9121109ae039b93b788 Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Tue, 8 Apr 2008 14:39:43 +0000 Subject: [PATCH] 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. --- common/TestUtils.hs | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/common/TestUtils.hs b/common/TestUtils.hs index 8d6ea4c..df27843 100644 --- a/common/TestUtils.hs +++ b/common/TestUtils.hs @@ -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