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

Test.QuickCheck.StateModel.Lockstep.Defaults

Description

Default implementations for the quickcheck-dynamic class methods

Intended for qualified import.

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

Default implementations for methods of StateModel

initialState :: state -> Lockstep state Source #

Default implementation for initialState

nextState :: forall state a. (InLockstep state, Typeable a) => Lockstep state -> LockstepAction state a -> Var a -> Lockstep state Source #

Default implementation for nextState

precondition :: InLockstep state => Lockstep state -> LockstepAction state a -> Bool Source #

Default implementation for precondition

The default precondition only checks that all variables have a value and that the operations on them are defined.

arbitraryAction :: InLockstep state => VarContext -> Lockstep state -> Gen (Any (LockstepAction state)) Source #

Default implementation for arbitraryAction

shrinkAction :: InLockstep state => VarContext -> Lockstep state -> LockstepAction state a -> [Any (LockstepAction state)] Source #

Default implementation for shrinkAction

Default implementations for methods of RunModel

postcondition :: forall m state a. RunLockstep state m => (Lockstep state, Lockstep state) -> LockstepAction state a -> LookUp m -> Realized m a -> PostconditionM m Bool Source #

Default implementation for postcondition

The default postcondition verifies that the real system and the model return the same results, up to " observability ".

monitoring :: forall m state a. RunLockstep state m => Proxy m -> (Lockstep state, Lockstep state) -> LockstepAction state a -> LookUp m -> Either (Error (Lockstep state)) (Realized m a) -> Property -> Property Source #

Orphan instances

HasVariables (Lockstep state) Source #

Ignore variables for lockstep state.

We largely ignore quickcheck-dynamic's variables in the lockstep framework, since it does its own accounting of model variables.

Instance details

Methods

getAllVariables :: Lockstep state -> Set (Any Var) #

InLockstep state => HasVariables (Action (Lockstep state) a) Source #

Do not ignore variables for lockstep actions.

quickcheck-dynamic prints counterexamples as code that is more or less runnable, which requires a sensible HasVariables instance for lockstep actions.

Instance details

Methods

getAllVariables :: Action (Lockstep state) a -> Set (Any Var) #