| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Mutagen.Property
Contents
Description
Combinators for constructing and running properties.
Synopsis
- type IsArgs a = (Show a, Eq a, Ord a, Typeable a, Arbitrary a, Fragmentable a, Mutable a, Lazy a)
- data Args = IsArgs a => Args a
- data Result = Result {}
- pattern Passed :: Result
- pattern Failed :: Result
- pattern Discarded :: Result
- data Prop
- unProp :: Prop -> IO Result
- mapProp :: (Result -> Result) -> Prop -> Prop
- protectProp :: Prop -> Prop
- (==>) :: IsProp a => Bool -> a -> Prop
- discardAfter :: IsProp a => Int -> a -> Prop
- class IsProp a where
- data Property = Property (Gen Args) (Args -> Prop)
- mapProperty :: (Prop -> Prop) -> Property -> Property
- forAll :: (IsArgs a, IsProp b) => Gen a -> (a -> b) -> Property
- expectFailure :: Testable prop => prop -> Property
- class Testable a where
Property arguments
type IsArgs a = (Show a, Eq a, Ord a, Typeable a, Arbitrary a, Fragmentable a, Mutable a, Lazy a) Source #
Constraints needed for types that can be used as property arguments.
Test arguments hidden behind an existential.
Result of executing a property.
Constructors
| Result | |
Fields
| |
Executable properties as IO computations producing results.
protectProp :: Prop -> Prop Source #
Protect a prop against exceptions during evaluation.
discardAfter :: IsProp a => Int -> a -> Prop Source #
Discard a property if it takes more than some milliseconds.
Types that can produce props.
Properties encapsulating generators of arguments and runner functions.
mapProperty :: (Prop -> Prop) -> Property -> Property Source #
Map a function over the inner executable Prop of a property.
forAll :: (IsArgs a, IsProp b) => Gen a -> (a -> b) -> Property Source #
Universal quantification over generated arguments.
expectFailure :: Testable prop => prop -> Property Source #
Expect a property to fail.