Safe Haskell | None |
---|---|
Language | GHC2021 |
Skeletest.Assertions
Contents
Synopsis
- shouldBe :: (HasCallStack, Testable m, Eq a) => a -> a -> m ()
- shouldNotBe :: (HasCallStack, Testable m, Eq a) => a -> a -> m ()
- shouldSatisfy :: (HasCallStack, Testable m) => a -> Predicate m a -> m ()
- shouldNotSatisfy :: (HasCallStack, Testable m) => a -> Predicate m a -> m ()
- context :: Testable m => String -> m a -> m a
- failTest :: (HasCallStack, Testable m) => String -> m a
- data AssertionFail = AssertionFail {}
- class MonadIO m => Testable (m :: Type -> Type)
- runTestable :: Testable m => m () -> IO TestResult
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.
data AssertionFail Source #
Constructors
AssertionFail | |
Fields |
Instances
Exception AssertionFail Source # | |
Defined in Skeletest.Internal.TestRunner Methods toException :: AssertionFail -> SomeException # fromException :: SomeException -> Maybe AssertionFail # displayException :: AssertionFail -> String # backtraceDesired :: AssertionFail -> Bool # | |
Show AssertionFail Source # | |
Defined in Skeletest.Internal.TestRunner Methods showsPrec :: Int -> AssertionFail -> ShowS # show :: AssertionFail -> String # showList :: [AssertionFail] -> ShowS # |
Testable
class MonadIO m => Testable (m :: Type -> Type) Source #
Minimal complete definition
Instances
Testable IO Source # | |
Defined in Skeletest.Assertions Methods runTestable :: IO () -> IO TestResult Source # context :: String -> IO a -> IO a Source # throwFailure :: AssertionFail -> IO a Source # | |
Testable PropertyM Source # | |
Defined in Skeletest.Prop.Internal Methods runTestable :: PropertyM () -> IO TestResult Source # context :: String -> PropertyM a -> PropertyM a Source # throwFailure :: AssertionFail -> PropertyM a Source # |
runTestable :: Testable m => m () -> IO TestResult Source #