Copyright | (C) 2017 ATS Advanced Telematic Systems GmbH Li-yao Xia |
---|---|

License | BSD-style (see the file LICENSE) |

Maintainer | Stevan Andjelkovic <stevan.andjelkovic@here.com> |

Stability | provisional |

Portability | non-portable (GHC extensions) |

Safe Haskell | Safe |

Language | Haskell2010 |

This module exports some QuickCheck utility functions. Some of these should perhaps be upstreamed.

## Synopsis

- liftProperty :: Monad m => Property -> PropertyM m ()
- whenFailM :: Monad m => IO () -> Property -> PropertyM m ()
- forAllShrinkShow :: Testable prop => Gen a -> (a -> [a]) -> (a -> String) -> (a -> prop) -> Property
- anyP :: (a -> Property) -> [a] -> Property
- shrinkPair :: (a -> [a]) -> (a, a) -> [(a, a)]
- shrinkPair' :: (a -> [a]) -> (b -> [b]) -> (a, b) -> [(a, b)]
- suchThatOneOf :: [(Int, Gen a)] -> (a -> Bool) -> Gen (Maybe a)
- oldCover :: Testable prop => Bool -> Int -> String -> prop -> Property

# Documentation

liftProperty :: Monad m => Property -> PropertyM m () Source #

Lifts a plain property into a monadic property.

forAllShrinkShow :: Testable prop => Gen a -> (a -> [a]) -> (a -> String) -> (a -> prop) -> Property Source #

A variant of `forAllShrink`

with an
explicit show function.

shrinkPair :: (a -> [a]) -> (a, a) -> [(a, a)] Source #

Same above, but for homogeneous pairs.

shrinkPair' :: (a -> [a]) -> (b -> [b]) -> (a, b) -> [(a, b)] Source #

Given shrinkers for the components of a pair we can shrink the pair.