before Run a custom action before every spec item, to set up an inner resource inner.
Note that this function turns off shrinking. See https://github.com/nick8325/quickcheck/issues/331
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
Modulesydtest-0.22.0.0Haskell2010
before Run a custom action before every spec item, to set up an inner resource inner.
Note that this function turns off shrinking. See https://github.com/nick8325/quickcheck/issues/331
before_ Run a custom action before every spec item without setting up any inner resources.
Note that this function turns off shrinking. See https://github.com/nick8325/quickcheck/issues/331
Run a custom action before every spec item, to set up an inner resource newInner using the previously set up resource oldInner
Note that this function turns off shrinking. See https://github.com/nick8325/quickcheck/issues/331
Run a custom action before every spec item, to set up an inner resource newInner using the previously set up resource oldInner and potentially any of the outer resources
Note that this function turns off shrinking. See https://github.com/nick8325/quickcheck/issues/331
after Run a custom action after every spec item, using the inner resource c.
Note that this function turns off shrinking. See https://github.com/nick8325/quickcheck/issues/331
after_ Run a custom action after every spec item without using any inner resources.
Note that this function turns off shrinking. See https://github.com/nick8325/quickcheck/issues/331
around Run a custom action before and/or after every spec item, to provide access to an inner resource c.
See the FOOTGUN note in the docs for around_.
Note that this function turns off shrinking. See https://github.com/nick8325/quickcheck/issues/331
around_ Run a custom action before and/or after every spec item without accessing any inner resources.
It is important that the wrapper function that you provide runs the action that it gets _exactly once_.
This combinator gives the programmer a lot of power. In fact, it gives the programmer enough power to break the test framework. Indeed, you can provide a wrapper function that just _doesn't_ run the function like this:
spec :: Spec
spec = do
let don'tDo :: IO () -> IO ()
don'tDo _ = pure ()
around_ don'tDo $ do
it "should pass" TrueDuring execution, you'll then get an error like this:
thread blocked indefinitely in an MVar operationThe same problem exists when using Test.Syd.Def.Around.aroundAll_.
The same thing will go wrong if you run the given action more than once like this:
spec :: Spec
spec = do
let doTwice :: IO () -> IO ()
doTwice f = f >> f
around_ doTwice $ do
it "should pass" TrueNote: If you're interested in fixing this, talk to me, but only after GHC has gotten impredicative types because that will likely be a requirement.
Note that this function turns off shrinking. See https://github.com/nick8325/quickcheck/issues/331
Run a custom action before and/or after every spec item, to provide access to an inner resource c while using the inner resource d.
See the FOOTGUN note in the docs for around_.
Note that this function turns off shrinking. See https://github.com/nick8325/quickcheck/issues/331
aroundWith' Run a custom action around every spec item, to provide access to an inner resource newInner while using the inner resource oldInner and any outer resource available.
Note that this function turns off shrinking. See https://github.com/nick8325/quickcheck/issues/331