skeletest
Safe HaskellNone
LanguageGHC2021

Skeletest.Assertions

Synopsis

Documentation

shouldBe :: (HasCallStack, Testable m, Eq a) => a -> a -> m () infix 1 Source #

Assert that the given input should match the given value. Equivalent to actual shouldSatisfy P.eq expected

shouldNotBe :: (HasCallStack, Testable m, Eq a) => a -> a -> m () infix 1 Source #

Assert that the given input should not match the given value. Equivalent to actual shouldNotSatisfy P.eq expected

shouldSatisfy :: (HasCallStack, Testable m) => a -> Predicate m a -> m () infix 1 Source #

Assert that the given input should satisfy the given predicate.

shouldNotSatisfy :: (HasCallStack, Testable m) => a -> Predicate m a -> m () infix 1 Source #

Assert that the given input should not satisfy the given predicate.

context :: Testable m => String -> m a -> m a Source #

Add any context to display if the test fails.

>>> (code, stdout) <- runCommand ...
>>> context stdout $ code `shouldBe` ExitSuccess

failTest :: (HasCallStack, Testable m) => String -> m a Source #

Unconditionally fail the test with the given message.

Testable

class MonadIO m => Testable (m :: Type -> Type) Source #

Minimal complete definition

runTestable, context, throwFailure

Instances

Instances details
Testable IO Source # 
Instance details

Defined in Skeletest.Assertions

Testable PropertyM Source # 
Instance details

Defined in Skeletest.Prop.Internal

Orphan instances

Testable IO Source # 
Instance details