|
|
|
|
|
|
Synopsis |
|
|
|
|
Property and Testable types
|
|
|
|
class Testable prop where | Source |
|
The class of things which can be tested, i.e. turned into a property.
| | Methods | |
|
|
Type Prop
|
|
|
|
|
type Rose
|
|
|
|
|
|
|
|
|
Result type
|
|
|
Different kinds of callbacks
| Constructors | |
|
|
|
The result of a single test.
| Constructors | MkResult | | ok :: Maybe Bool | result of the test case; Nothing = discard
| expect :: Bool | indicates what the expected result of the property is
| reason :: String | a message indicating what went wrong
| interrupted :: Bool | indicates if the test case was cancelled by pressing ^C
| stamp :: [(String, Int)] | the collected values for this test case
| callbacks :: [Callback] | the callbacks for this test case
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Lifting and mapping functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Property combinators
|
|
|
Changes the maximum test case size for a property.
|
|
|
:: Testable prop | | => a -> [a] | The original argument
| -> a | | -> a -> prop | | -> Property | | Shrinks the argument to property if it fails. Shrinking is done
automatically for most types. This is only needed weh you want to
override the default behavior.
|
|
|
|
Disables shrinking for a property altogether.
|
|
|
Adds a callback
|
|
|
Performs an IO action after the last failure of a property.
|
|
|
Performs an IO action every time a property fails. Thus,
if shrinking is done, this can be used to keep track of the
failures along the way.
|
|
|
Modifies a property so that it is expected to fail for some test cases.
|
|
|
Attaches a label to a property. This is used for reporting
test case distribution.
|
|
|
Labels a property with a value:
collect x = label (show x)
|
|
|
|
|
|
:: Testable prop | | => Bool | The required percentage (0-100) of test cases.
| -> Int | Label for the test case class.
| -> String | | -> prop | | -> Property | | Checks that at least the given proportion of the test cases belong
to the given class.
|
|
|
|
Implication for properties: The resulting property holds if
the first argument is False, or if the given property holds.
|
|
|
Considers a property failed if it does not complete within
the given number of microseconds.
|
|
|
Explicit universal quantification: uses an explicitly given
test case generator.
|
|
|
Like forAll, but tries to shrink the argument for failing test cases.
|
|
|
|
Produced by Haddock version 2.6.0 |