Copyright | (c) John Maraist 2022 |
---|---|

License | GPL3 |

Maintainer | haskell-tlt@maraist.org |

Stability | experimental |

Portability | POSIX |

Safe Haskell | Safe-Inferred |

Language | Haskell2010 |

Standard assertion vocabulary for the `TLT`

testing system. See
`TLT`

for more information.

## Synopsis

- (@==-) :: (Monad m, Eq a, Show a) => a -> a -> Assertion m
- (@==) :: (Monad m, Eq a, Show a) => a -> m a -> Assertion m
- (@/=-) :: (Monad m, Eq a, Show a) => a -> a -> Assertion m
- (@/=) :: (Monad m, Eq a, Show a) => a -> m a -> Assertion m
- (@<-) :: (Monad m, Ord a, Show a) => a -> a -> Assertion m
- (@<) :: (Monad m, Ord a, Show a) => a -> m a -> Assertion m
- (@>-) :: (Monad m, Ord a, Show a) => a -> a -> Assertion m
- (@>) :: (Monad m, Ord a, Show a) => a -> m a -> Assertion m
- (@<=-) :: (Monad m, Ord a, Show a) => a -> a -> Assertion m
- (@<=) :: (Monad m, Ord a, Show a) => a -> m a -> Assertion m
- (@>=-) :: (Monad m, Ord a, Show a) => a -> a -> Assertion m
- (@>=) :: (Monad m, Ord a, Show a) => a -> m a -> Assertion m
- emptyP :: (Monad m, Traversable t) => t a -> Assertion m
- empty :: (Monad m, Traversable t) => m (t a) -> Assertion m
- nonemptyP :: (Monad m, Traversable t) => t a -> Assertion m
- nonempty :: (Monad m, Traversable t) => m (t a) -> Assertion m
- nothingP :: Monad m => Maybe a -> Assertion m
- nothing :: Monad m => m (Maybe a) -> Assertion m

# Documentation

(@==-) :: (Monad m, Eq a, Show a) => a -> a -> Assertion m infix 1 Source #

Assert that two values are equal. This assertion takes an
expected and an actual *value*; see `(@==)`

to compare the result
of a *monadic computation* to an expected value.

##### Examples

test :: Monad m => TLT m () test = do "Make sure that 2 is still equal to itself" ~: 2 @==- 2 "Make sure that there are four lights" ~: 4 @==- length lights

(@==) :: (Monad m, Eq a, Show a) => a -> m a -> Assertion m infix 1 Source #

Assert that a calculated value is as expected. This assertion
compare the result of a *monadic computation* to an expected value;
see `(@==-)`

to compare an *actual value* to the expected value.

##### Examples

test :: Monad m => TLT m () test = do "Make sure that 2 is still equal to itself" ~: 2 @== return 2 "Make sure that there are four lights" ~: 4 @== countLights -- where countLights :: m Int

(@/=-) :: (Monad m, Eq a, Show a) => a -> a -> Assertion m infix 1 Source #

Assert that two values are not equal. This assertion takes an
expected and an actual *value*; see `(@/=)`

to compare the result
of a *monadic computation* to an expected value.

(@/=) :: (Monad m, Eq a, Show a) => a -> m a -> Assertion m infix 1 Source #

Assert that a calculated value differs from some known value.
This assertion compares the result of a *monadic computation* to an
expected value; see `(@/=-)`

to compare an *actual value* to the
expected value.

(@<-) :: (Monad m, Ord a, Show a) => a -> a -> Assertion m infix 1 Source #

Assert that a given boundary is strictly less than some value.
This assertion takes an expected and an actual *value*; see `(@<)`

to compare the result of a *monadic computation* to an expected
value.

(@<) :: (Monad m, Ord a, Show a) => a -> m a -> Assertion m infix 1 Source #

Assert that a given, constant boundary is strictly less than some
calculated value. This assertion compares the result of a /monadic
computation/ to an expected value; see `(@<-)`

to compare an
*actual value* to the expected value.

(@>-) :: (Monad m, Ord a, Show a) => a -> a -> Assertion m infix 1 Source #

Assert that a given boundary is strictly less than some value.
This assertion takes an expected and an actual *value*; see `(@>)`

to compare the result of a *monadic computation* to an expected
value.

(@>) :: (Monad m, Ord a, Show a) => a -> m a -> Assertion m infix 1 Source #

Assert that a given, constant boundary is strictly less than some
calculated value. This assertion compares the result of a /monadic
computation/ to an expected value; see `(@>-)`

to compare an
*actual value* to the expected value.

(@<=-) :: (Monad m, Ord a, Show a) => a -> a -> Assertion m infix 1 Source #

Assert that a given boundary is strictly less than some value.
This assertion takes an expected and an actual *value*; see `(@<=)`

to compare the result of a *monadic computation* to an expected
value.

(@<=) :: (Monad m, Ord a, Show a) => a -> m a -> Assertion m infix 1 Source #

Assert that a given, constant boundary is strictly less than some
calculated value. This assertion compares the result of a /monadic
computation/ to an expected value; see `(@<=-)`

to compare an
*actual value* to the expected value.

(@>=-) :: (Monad m, Ord a, Show a) => a -> a -> Assertion m infix 1 Source #

Assert that a given boundary is strictly less than some value.
This assertion takes an expected and an actual *value*; see `(@>=)`

to compare the result of a *monadic computation* to an expected
value.

(@>=) :: (Monad m, Ord a, Show a) => a -> m a -> Assertion m infix 1 Source #

Assert that a given, constant boundary is strictly less than some
calculated value. This assertion compares the result of a /monadic
computation/ to an expected value; see `(@>=-)`

to compare an
*actual value* to the expected value.

emptyP :: (Monad m, Traversable t) => t a -> Assertion m Source #

Assert that a pure traversable structure (such as a list) is empty.

empty :: (Monad m, Traversable t) => m (t a) -> Assertion m Source #

Assert that a traversable structure (such as a list) returned from a computation is empty.

nonemptyP :: (Monad m, Traversable t) => t a -> Assertion m Source #

Assert that a pure traversable structure (such as a list) is nonempty.