1.x to 2.x
- Test cases are written in terms of a new
Failuretype has been replaced with a
Conditiontype (actually in 1.12).
- Random testing takes an optional length bound.
- Atomically-checked invariants over shared mutable state.
See the changelogs for the full details.
ConcT type is now an alias for
Program Basic has all the instances
ConcT did, defined using
~ instance trick, so this shouldn't be a breaking change:
instance (pty ~ Basic) => MonadTrans (Program pty) instance (pty ~ Basic) => MonadCatch (Program pty n) instance (pty ~ Basic) => MonadThrow (Program pty n) instance (pty ~ Basic) => MonadMask (Program pty n) instance (pty ~ Basic, Monad n) => MonadConc (Program pty n) instance (pty ~ Basic, MonadIO n) => MonadIO (Program pty n)
dontCheck function has been removed in favour of
do x <- dontCheck setup action x -- becomes withSetup setup action
subconcurrency function has been removed in favour of
do x <- setup y <- subconcurrency (action x) teardown x y -- becomes withSetupAndTeardown setup teardown action
subconcurrency functions used to throw
runtime errors if nested. This is not possible with
withSetupAndTeardown due to their types:
withSetup :: Program Basic n x -- ^ Setup action -> (x -> Program Basic n a) -- ^ Main program -> Program (WithSetup x) n a withSetupAndTeardown :: Program Basic n x -- ^ Setup action -> (x -> Either Condition y -> Program Basic n a) -- ^ Teardown action -> (x -> Program Basic n y) -- ^ Main program -> Program (WithSetupAndTeardown x y) n a
Previously, multiple calls to
subconcurrency could be sequenced in
the same test case. This is not possible using
withSetupAndTeardown. If you rely on this behaviour, please
:issue:`file an issue <>`.
Deadlockconstructors have been merged.
- Internal errors have been split into the
Errortype and are raised as exceptions, instead of being returned as conditions.
The name "failure" has been a recurring source of confusion, because an individual execution can "fail" without the predicate as a whole failing. My hope is that the more neutral "condition" will prevent this confusion.
All the deprecated special-purpose functions have been removed. Use
*WithSettings functions instead.