Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Test.Falsify.Interactive
Contents
Description
Utilities for interaction with falsify in ghci
Synopsis
- falsify :: forall e a. Property' e a -> IO (Maybe e)
- falsify' :: forall e a. Property' e a -> IO (Maybe (NonEmpty e))
- sample :: Gen a -> IO a
- shrink :: forall a. (a -> Bool) -> Gen a -> IO (Maybe a)
- shrink' :: forall e a. (a -> Maybe e) -> Gen a -> IO (Maybe (NonEmpty e))
- module Test.Falsify.Property
- pattern Fn :: (a -> b) -> Fun a b
- pattern Fn2 :: (a -> b -> c) -> Fun (a, b) c
- pattern Fn3 :: (a -> b -> c -> d) -> Fun (a, b, c) d
Documentation
falsify :: forall e a. Property' e a -> IO (Maybe e) Source #
Try to falsify the given property
Reports the counter-example, if we find any.
falsify' :: forall e a. Property' e a -> IO (Maybe (NonEmpty e)) Source #
Generalization of falsify
that reports the full shrink history
shrink :: forall a. (a -> Bool) -> Gen a -> IO (Maybe a) Source #
Shrink counter-example
This will run the generator repeatedly until it finds a counter-example to the given property, and will then shrink it.
Returns Nothing
if no counter-example could be found.
shrink' :: forall e a. (a -> Maybe e) -> Gen a -> IO (Maybe (NonEmpty e)) Source #
Generalization of shrink
. Returns the full shrink history.
Re-exports
module Test.Falsify.Property
Functions
pattern Fn :: (a -> b) -> Fun a b Source #
Pattern synonym useful when generating functions of one argument