Safe Haskell | None |
---|---|
Language | Haskell2010 |
Foundation.Check
Contents
- 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
- data Test where
- testName :: Test -> String
- data PropertyCheck
- data Property = Prop {}
- class IsProperty p where
- (===) :: (Show a, Eq a) => a -> a -> PropertyCheck
- propertyCompare :: Show a => String -> (a -> a -> Bool) -> a -> a -> PropertyCheck
- propertyAnd :: PropertyCheck -> PropertyCheck -> PropertyCheck
- propertyFail :: String -> PropertyCheck
- defaultMain :: Test -> IO ()
Documentation
How to generate an arbitrary value for a
Minimal complete definition
Instances
Arbitrary Bool # | |
Arbitrary Char # | |
Arbitrary Double # | |
Arbitrary Int # | |
Arbitrary Int8 # | |
Arbitrary Int16 # | |
Arbitrary Int32 # | |
Arbitrary Int64 # | |
Arbitrary Integer # | |
Arbitrary Word # | |
Arbitrary Word8 # | |
Arbitrary Word16 # | |
Arbitrary Word32 # | |
Arbitrary Word64 # | |
Arbitrary Natural # | |
Arbitrary String # | |
Arbitrary a => Arbitrary (Maybe a) # | |
(Arbitrary l, Arbitrary r) => Arbitrary (Either l r) # | |
(Arbitrary a, Arbitrary b) => Arbitrary (a, b) # | |
(Arbitrary a, Arbitrary b, Arbitrary c) => Arbitrary (a, b, c) # | |
(Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d) => Arbitrary (a, b, c, d) # | |
(Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e) => Arbitrary (a, b, c, d, e) # | |
(Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f) => Arbitrary (a, b, c, d, e, f) # | |
Property
class IsProperty p where #
Minimal complete definition
Instances
IsProperty Bool # | |
IsProperty Property # | |
IsProperty PropertyCheck # | |
(Show a, Arbitrary a, IsProperty prop) => IsProperty (a -> prop) # | |
IsProperty (String, Bool) # | |
(===) :: (Show a, Eq a) => a -> a -> PropertyCheck infix 4 #
Arguments
:: Show 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 |
propertyAnd :: PropertyCheck -> PropertyCheck -> PropertyCheck #
propertyFail :: String -> PropertyCheck #
As Program
defaultMain :: Test -> IO () #
Run tests