HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulehedgehog-extras-0.10.1.0Haskell2010

Hedgehog.Extras.Test.Tripwire

This modules provides a tripwire abstraction. You can use tripwire as a detection mechanism if the code path was executed. Trip a tripwire with trip in the place where you'd like to detect if it was reached. The tripwire can then be checked in the other place in the code using for example isTripped or assertNotTripped.

  • 1 type
  • 9 values

Create a tripwire

3 declarations
datadata Tripwire
#

Represents a tripwire which can be tripped only once. It can be used to detect if a particular code path was reached.

Instances1Show
  • Show TripwireDefined in hedgehog-extras-0.10.1.0 · Hedgehog.Extras.Test.Tripwire

Tripwire operations

5 declarations
valuetrip :: (HasCallStack, MonadIO m, MonadTest m) => Tripwire -> m ()
#

Triggers the tripwire and registers the place of the first trigger. Idempotent. Prints the information in the test log about tripping the tripwire.

valuetrip_ :: (HasCallStack, MonadIO m) => Tripwire -> m ()
#

Triggers the tripwire and registers the place of the first trigger. Idempotent. A silent variant of trip which does not require MonadTest, but also does not log the information about tripping.

Assertions

2 declarations