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

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

Test.StateMachine.Internal.Utils

Description

 

Synopsis

Documentation

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

Lifts any to properties.

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

Lifts a plain property into a monadic property.

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

alwaysP :: Int -> Property -> Property Source #

A property that tests prop repeatedly n times, failing as soon as any of the tests of prop fails.

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

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

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

Same above, but for homogeneous pairs.

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

A variant of forAllShrink with an explicit show function.

forAllShrinkShowC :: Testable prop => Gen a -> (a -> [a]) -> (a -> String) -> (a -> prop) -> PropertyOf (a :&: Counterexample prop) Source #

nub :: Ord a => [a] -> [a] Source #

Remove duplicate elements from a list.

dropLast :: Int -> [a] -> [a] Source #

Drop last n elements of a list.

toLast :: Int -> [a] -> a Source #

Indexing starting from the back of a list.