[Fixed testing bug. Nils Anders Danielsson **20060512100205 + The testDistribution tests now print out a somewhat informative message when they fail. + The len distribution test has been parameterised, so that it can be used both for lists and trees. Now prop_trees_have_decent_depth does not result in an error. ] { hunk ./Test/ChasingBottoms/ContinuousFunctions/Tests.hs 77 - return $ apply test result + let (ok, msg) = apply test result + unless ok $ putStrLn msg + return ok hunk ./Test/ChasingBottoms/ContinuousFunctions/Tests.hs 82 - apply _ _ = False + apply _ _ = (False, "Test failed.") hunk ./Test/ChasingBottoms/ContinuousFunctions/Tests.hs 90 -spread n args = noUniqueArgs % n >= 3%4 +spread n args = (uniqueShare >= 3%4, "uniqueShare: " ++ show uniqueShare) hunk ./Test/ChasingBottoms/ContinuousFunctions/Tests.hs 92 + uniqueShare = noUniqueArgs % n hunk ./Test/ChasingBottoms/ContinuousFunctions/Tests.hs 94 -len n args = maxLen >= 20 && averageLen >= 6 && noShortLists % noArgs >= 1%10 +len max avg short n args = + ( maxLen >= max && averageLen >= avg && shortShare >= 1%10 + , "maxLen: " ++ show maxLen ++ + ", averageLen: " ++ show averageLen ++ + ", shortShare: " ++ show shortShare + ) hunk ./Test/ChasingBottoms/ContinuousFunctions/Tests.hs 102 - noShortLists = genericLength (filter (<= 5) lengths) + noShortLists = genericLength (filter (<= short) lengths) hunk ./Test/ChasingBottoms/ContinuousFunctions/Tests.hs 105 + shortShare = noShortLists % noArgs hunk ./Test/ChasingBottoms/ContinuousFunctions/Tests.hs 119 -prop_lists_have_decent_length = testDistribution len $ +prop_lists_have_decent_length = testDistribution (len 20 6 5) $ hunk ./Test/ChasingBottoms/ContinuousFunctions/Tests.hs 127 -prop_trees_have_decent_depth = testDistribution len $ +prop_trees_have_decent_depth = testDistribution (len 6 2 2) $ }