| 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
- between :: (Word, Word) -> Gen Word
- 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
- forAll :: (Show a, IsProperty prop) => Gen a -> (a -> prop) -> Property
- defaultMain :: Test -> IO ()
Documentation
Generator monad
class Arbitrary a where Source #
How to generate an arbitrary value for a
Minimal complete definition
Instances
| Arbitrary Bool Source # | |
| Arbitrary Char Source # | |
| Arbitrary Double Source # | |
| Arbitrary Float Source # | |
| Arbitrary Int Source # | |
| Arbitrary Int8 Source # | |
| Arbitrary Int16 Source # | |
| Arbitrary Int32 Source # | |
| Arbitrary Int64 Source # | |
| Arbitrary Integer Source # | |
| Arbitrary Word Source # | |
| Arbitrary Word8 Source # | |
| Arbitrary Word16 Source # | |
| Arbitrary Word32 Source # | |
| Arbitrary Word64 Source # | |
| Arbitrary Natural Source # | |
| Arbitrary String Source # | |
| Arbitrary a => Arbitrary (Maybe a) Source # | |
| (Arbitrary l, Arbitrary r) => Arbitrary (Either l r) Source # | |
| (Arbitrary a, Arbitrary b) => Arbitrary (a, b) Source # | |
| (Arbitrary a, Arbitrary b, Arbitrary c) => Arbitrary (a, b, c) Source # | |
| (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d) => Arbitrary (a, b, c, d) Source # | |
| (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e) => Arbitrary (a, b, c, d, e) Source # | |
| (Arbitrary a, Arbitrary b, Arbitrary c, Arbitrary d, Arbitrary e, Arbitrary f) => Arbitrary (a, b, c, d, e, f) Source # | |
Property
Instances
class IsProperty p where Source #
Minimal complete definition
Instances
| IsProperty Bool Source # | |
| IsProperty Property Source # | |
| IsProperty PropertyCheck Source # | |
| (Show a, Arbitrary a, IsProperty prop) => IsProperty (a -> prop) Source # | |
| IsProperty (String, Bool) Source # | |
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 |
propertyFail :: String -> PropertyCheck Source #
As Program
defaultMain :: Test -> IO () Source #
Run tests