falsify-0.2.0: Property-based testing with internal integrated shrinking
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Falsify.Interactive

Description

Utilities for interaction with falsify in ghci

Synopsis

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

sample :: Gen a -> IO a Source #

Sample generator

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

Functions

pattern Fn :: (a -> b) -> Fun a b Source #

Pattern synonym useful when generating functions of one argument

pattern Fn2 :: (a -> b -> c) -> Fun (a, b) c Source #

Pattern synonym useful when generating functions of two arguments

pattern Fn3 :: (a -> b -> c -> d) -> Fun (a, b, c) d Source #

Pattern synonym useful when generating functions of three arguments