polysemy-test-0.9.0.0: Polysemy effects for testing
Safe HaskellSafe-Inferred
LanguageGHC2021

Polysemy.Test.Data.TestError

Description

TestError data type, Internal

Synopsis

Documentation

data TestError where Source #

An error that occurred in the test machinery.

The pattern synonym is used for construction to ensure that the call site's stack is stored. There is no IsString instance because it can't propagate the call stack. Use testError to throw a string literal.

Bundled Patterns

pattern TestError :: HasCallStack => HasCallStack => Text -> TestError

Construct a test error so that the call site's stack is stored in the value, for printing the correct location in hedgehog messages.

Instances

Instances details
Show TestError Source # 
Instance details

Defined in Polysemy.Test.Data.TestError

Eq TestError Source # 
Instance details

Defined in Polysemy.Test.Data.TestError

testError :: forall a r. HasCallStack => Member (Error TestError) r => Text -> Sem r a Source #

Throw a TestError with the call site's stack.