License | BSD-style |
---|---|
Maintainer | Foundation maintainers |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
An implementation of a test framework and property expression & testing
Synopsis
- data Gen a
- class Arbitrary a where
- oneof :: NonEmpty [Gen a] -> Gen a
- elements :: NonEmpty [a] -> Gen a
- frequency :: NonEmpty [(Word, Gen a)] -> Gen a
- between :: (Word, Word) -> Gen Word
- data Test where
- testName :: Test -> String
- data PropertyCheck
- data Property = Prop {}
- class IsProperty p where
- (===) :: (Show a, Eq a, Typeable a) => a -> a -> PropertyCheck
- propertyCompare :: (Show a, Typeable a) => String -> (a -> a -> Bool) -> a -> a -> PropertyCheck
- propertyCompareWith :: String -> (a -> a -> Bool) -> (a -> String) -> a -> a -> PropertyCheck
- propertyAnd :: PropertyCheck -> PropertyCheck -> PropertyCheck
- propertyFail :: String -> PropertyCheck
- forAll :: (Show a, IsProperty prop) => Gen a -> (a -> prop) -> Property
- data Check a
- validate :: IsProperty prop => String -> prop -> Check ()
- pick :: String -> IO a -> Check a
- iterateProperty :: CountOf TestResult -> GenParams -> (Word64 -> GenRng) -> Property -> IO (PropertyResult, CountOf TestResult)
Documentation
class Arbitrary a where Source #
How to generate an arbitrary value for a
Instances
different type of tests supported
Property
data PropertyCheck Source #
The type of check this test did for a property
Instances
IsProperty PropertyCheck Source # | |
Defined in Foundation.Check.Property property :: PropertyCheck -> Property Source # |
Instances
class IsProperty p where Source #
Instances
IsProperty Property Source # | |
IsProperty PropertyCheck Source # | |
Defined in Foundation.Check.Property property :: PropertyCheck -> Property Source # | |
IsProperty Bool Source # | |
IsProperty (String, Bool) Source # | |
(Show a, Arbitrary a, IsProperty prop) => IsProperty (a -> prop) Source # | |
Defined in Foundation.Check.Property |
(===) :: (Show a, Eq a, Typeable a) => a -> a -> PropertyCheck infix 4 Source #
A property that check for equality of its 2 members.
:: (Show a, Typeable a) | |
=> String | name of the function used for comparaison, e.g. (<) |
-> (a -> a -> Bool) | function used for value comparaison |
-> a | value left of the operator |
-> a | value right of the operator |
-> PropertyCheck |
:: String | name of the function used for comparaison, e.g. (<) |
-> (a -> a -> Bool) | function used for value comparaison |
-> (a -> String) | function used to pretty print the values |
-> a | value left of the operator |
-> a | value right of the operator |
-> PropertyCheck |
propertyAnd :: PropertyCheck -> PropertyCheck -> PropertyCheck Source #
A conjuctive property composed of 2 properties that need to pass
propertyFail :: String -> PropertyCheck Source #
forAll :: (Show a, IsProperty prop) => Gen a -> (a -> prop) -> Property Source #
Running a generator for a specific type under a property