Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Run lockstep tests
Intended for qualified import.
import Test.QuickCheck.StateModel.Lockstep.Run qualified as Lockstep
Synopsis
- tagActions :: forall state. InLockstep state => Proxy state -> Actions (Lockstep state) -> Property
- labelActions :: forall state. InLockstep state => Actions (Lockstep state) -> [String]
- runActions :: RunLockstep state IO => Proxy state -> Actions (Lockstep state) -> Property
- runActionsBracket :: RunLockstep state m => Proxy state -> IO st -> (st -> IO ()) -> (m Property -> st -> IO Property) -> Actions (Lockstep state) -> Property
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 #
:: 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
. In this case, using ReaderT
r IO
as the runner argument
is a reasonable choice.runReaderT