Test.Assert
- Package
- purescript-assert
- Repository
- purescript/purescript-assert
#assertEqual Source
assertEqual :: forall a. Eq a => Show a => { actual :: a, expected :: a } -> Effect UnitCompares the expected and actual values for equality and
throws a runtime exception when the values are not equal.
The message indicates the expected value and the actual value.
#assertFalse Source
assertFalse :: Boolean -> Effect UnitThrows a runtime exception when the value is true.
The message indicates the expected value (false)
and the actual value (true).
#assertThrows Source
assertThrows :: forall a. (Unit -> a) -> Effect UnitThrows a runtime exception with message "Assertion failed: An error should have been thrown", unless the argument throws an exception when evaluated.
This function is specifically for testing unsafe pure code; for example,
to make sure that an exception is thrown if a precondition is not
satisfied. Functions which use Effect a can be
tested with catchException instead.
#assertThrows' Source
assertThrows' :: forall a. String -> (Unit -> a) -> Effect UnitThrows a runtime exception with the specified message, unless the argument throws an exception when evaluated.
This function is specifically for testing unsafe pure code; for example,
to make sure that an exception is thrown if a precondition is not
satisfied. Functions which use Effect a can be
tested with catchException instead.
- Modules
- Test.
Assert