quickcheck-lockstep-0.2.1: Library for lockstep-style testing with 'quickcheck-dynamic'
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.QuickCheck.StateModel.Lockstep.Run

Description

Run lockstep tests

Intended for qualified import.

import Test.QuickCheck.StateModel.Lockstep.Run qualified as Lockstep
Synopsis

Finding labelled examples

tagActions :: forall state. InLockstep state => Proxy state -> Actions (Lockstep state) -> Property Source #

Tag a list of actions

This can be used together with QuickCheck's labelledExamples to test your tagging code as well as your shrinker (QuickCheck will try to produce minimal labelled examples).

Unlike runActions, this does not require a RunModel instance; this is executed against the model only.

labelActions :: forall state. InLockstep state => Actions (Lockstep state) -> [String] Source #

Run tests

runActions :: RunLockstep state IO => Proxy state -> Actions (Lockstep state) -> Property Source #

runActionsBracket Source #

Arguments

:: RunLockstep state m 
=> Proxy state 
-> IO st

Initialisation

-> (st -> IO ())

Cleanup

-> (m Property -> st -> IO Property)

Runner

-> Actions (Lockstep state) 
-> Property 

Convenience runner with support for state initialization

This is less general than runActions, but will be useful in many scenarios.

For most lockstep-style tests, a suitable monad to run the tests in is ReaderT r IO. In this case, using runReaderT as the runner argument is a reasonable choice.