Copyright | (c) Pawel Nosal 2021 |
---|---|
License | MIT |
Maintainer | p.nosal1986@gmail.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Extensions |
|
This module provide a set of combinators to assert Either type.
Synopsis
- isLeft :: HasCallStack => Assertion (Either a b)
- isRight :: HasCallStack => Assertion (Either a b)
- extractingRight :: HasCallStack => Assertion' (Either a b) b
- extractingLeft :: HasCallStack => Assertion' (Either a b) a
Documentation
isLeft :: HasCallStack => Assertion (Either a b) Source #
assert if subject under test is Left
assertThat (Left 10) isLeft
isRight :: HasCallStack => Assertion (Either a b) Source #
assert if subject under test is Right
assertThat (Left 10) isRight
extractingRight :: HasCallStack => Assertion' (Either a b) b Source #
assert if subject under test is Right and extract contained value
assertThat (Left 10) extractingRight
extractingLeft :: HasCallStack => Assertion' (Either a b) a Source #
assert if subject under test is Left and extract contained value
assertThat (Left 10) extractingLeft