Copyright | (c) Jorge Santiago Alvarez Cuadros 2015 |
---|---|
License | GPL-3 |
Maintainer | sanjorgek@ciencias.unam.mx |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
To get random "invalid" and "valid" data
- class Variant a where
- class VarTestable prop where
- mapTotalResultValid :: VarTestable prop => (Result -> Result) -> prop -> Property
- mapRoseResultValid :: VarTestable prop => (Rose Result -> Rose Result) -> prop -> Property
- mapPropValid :: VarTestable prop => (Prop -> Prop) -> prop -> Property
- callbackValid :: VarTestable prop => Callback -> prop -> Property
- counterexampleValid :: VarTestable prop => String -> prop -> Property
- showCounterexampleValid :: String -> IO String
- forAllShrinkValid :: (Show a, VarTestable prop) => Gen a -> (a -> [a]) -> (a -> prop) -> Property
- mapTotalResultInvalid :: VarTestable prop => (Result -> Result) -> prop -> Property
- mapRoseResultInvalid :: VarTestable prop => (Rose Result -> Rose Result) -> prop -> Property
- mapPropInvalid :: VarTestable prop => (Prop -> Prop) -> prop -> Property
- callbackInvalid :: VarTestable prop => Callback -> prop -> Property
- counterexampleInvalid :: VarTestable prop => String -> prop -> Property
- showCounterexampleInvalid :: String -> IO String
- forAllShrinkInvalid :: (Show a, VarTestable prop) => Gen a -> (a -> [a]) -> (a -> prop) -> Property
Documentation
class Variant a where Source #
You can define
>>>
instance (Varaint a) => Arbitrary a where {arbitrary = oneof [valid, invalid]}
class VarTestable prop where Source #
The class of things wich can be tested with invalid or valid input.
propertyValid :: prop -> Property Source #
Property for valid input
propertyInvalid :: prop -> Property Source #
Property for invalid input
VarTestable Bool Source # | Same as Testeable |
(Arbitrary a, Variant a, Show a, VarTestable prop) => VarTestable (a -> prop) Source # | Instead of variant we use valid or invalid generators |
mapTotalResultValid :: VarTestable prop => (Result -> Result) -> prop -> Property Source #
mapRoseResultValid :: VarTestable prop => (Rose Result -> Rose Result) -> prop -> Property Source #
mapPropValid :: VarTestable prop => (Prop -> Prop) -> prop -> Property Source #
callbackValid :: VarTestable prop => Callback -> prop -> Property Source #
Adds a callback
counterexampleValid :: VarTestable prop => String -> prop -> Property Source #
Adds the given string to the counterexample if the property fails.
forAllShrinkValid :: (Show a, VarTestable prop) => Gen a -> (a -> [a]) -> (a -> prop) -> Property Source #
Like forAll
, but tries to shrink the argument for failing test cases.
mapTotalResultInvalid :: VarTestable prop => (Result -> Result) -> prop -> Property Source #
mapRoseResultInvalid :: VarTestable prop => (Rose Result -> Rose Result) -> prop -> Property Source #
mapPropInvalid :: VarTestable prop => (Prop -> Prop) -> prop -> Property Source #
callbackInvalid :: VarTestable prop => Callback -> prop -> Property Source #
Adds a callback
counterexampleInvalid :: VarTestable prop => String -> prop -> Property Source #
Adds the given string to the counterexample if the property fails.
forAllShrinkInvalid :: (Show a, VarTestable prop) => Gen a -> (a -> [a]) -> (a -> prop) -> Property Source #
Like forAll
, but tries to shrink the argument for failing test cases.