Module Test

This module is undocumented. This is a list of its definitions.

(==>) :: Testable a => Boolean -> a -> Gen TestResult

cond ==> prop checks prop only if cond is True; otherwise the test run is skipped. Use it to state preconditions of a property.

CounterexampleRoot :: Counterexample
Failure :: Counterexample -> TestResult
Skipped :: TestResult
Success :: TestResult
WithParameter :: String -> Counterexample -> Counterexample
forAll :: Show a => Testable b => Gen a -> (a -> b) -> Gen TestResult

forAll gen f checks the property f for values produced by the generator gen, recording the generated value in the counterexample if the property fails.

injectParameter :: Show a => a -> TestResult -> TestResult

Adds the given parameter value to the counterexample of a failed test run. Other results are returned unchanged.

printCounterexample :: Counterexample -> <Proc> ()

Prints the parameter values of the counterexample, one per line.

property :: Testable a => a -> Gen TestResult

The given value as a generator of test results.

quickCheck :: Testable a => a -> <Proc> ()

Checks the given property with randomly generated values until 100 test runs have succeeded, and prints the outcome. If a run fails, the counterexample is printed. Gives up after 500 skipped runs.