hedgehog-extras-0.9.0.0: Supplemental library for hedgehog
Safe HaskellNone
LanguageHaskell2010

Hedgehog.Extras.Test.MonadAssertion

Synopsis

Documentation

class Monad m => MonadAssertion (m :: Type -> Type) where Source #

Methods

throwAssertion :: Failure -> m a Source #

catchAssertion :: m a -> (Failure -> m a) -> m a Source #

assertFailure :: (HasCallStack, Show a, MonadAssertion m, MonadTest m) => m a -> m Failure Source #

Run the given action and succeed if the action fails, but fail if it succeeds.

assertFailure_ :: (HasCallStack, Show a, MonadAssertion m, MonadTest m) => m a -> m () Source #

Run the given action and succeed if the action fails, but fail if it succeeds.

tryAssertion :: MonadAssertion m => m a -> m (Either Failure a) Source #

Attempt to run a function that may assert, returning either a failure or the result of the assertion.