General-purpose function to throw a test exception with a String.
Modulesandwich-0.3.1.0Haskell2010
Test.Sandwich.Expectations
Functions for making assertions about test behavior.
- 20 values
- Packagesandwich-0.3.1.0
- Exports20
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceExpectations.hs
Manually fail a test or mark as pending
4 declarationsThrows a Pending exception, which will cause the test to be marked as pending.
Throws a Pending exception with a message to add additional details.
Shorthand for a pending test example. You can quickly mark an it node as pending by putting an "x" in front of it.
Expecting failures
3 declarationsAssert that a given action should fail with some FailureReason.
Assert that a given action should fail with some FailureReason matching a predicate.
shouldThrow :: (HasCallStack, MonadUnliftIO m, Exception e)=> m aThe action to run.
-> (e -> Bool)A predicate on the exception to determine if it's as expected.
-> m ()
Asserts that an action should throw an exception. Accepts a predicate to determine if the exception matches.
Assertions
13 declarationsAsserts that two things are equal.
Asserts that two things are not equal.
Asserts that the given list contains a subsequence.
Asserts that the given list contains an item matching a predicate.
Asserts that the given list does not contain a subsequence.
Asserts that the given lists are equal as sets.
Asserts that the given list contains an item matching a predicate.
Asserts that the given text contains a substring.
Asserts that the given text does not contain a substring.