quickcheck-state-machine-0.4.1: Test monadic programs using state machine based models

Copyright(C) 2017 ATS Advanced Telematic Systems GmbH Li-yao Xia
LicenseBSD-style (see the file LICENSE)
MaintainerStevan Andjelkovic <stevan.andjelkovic@here.com>
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe
LanguageHaskell2010

Test.StateMachine.Utils

Description

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

Synopsis

Documentation

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

Lifts a plain property into a monadic property.

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

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

A variant of forAllShrink with an explicit show function.

anyP :: (a -> Property) -> [a] -> Property Source #

Lifts any to properties.

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.

suchThatOneOf :: [(Int, Gen a)] -> (a -> Bool) -> Gen (Maybe a) Source #