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.
Synopsis
- value expectationFailure
- value pending
- value pendingWith
- value xit
- value shouldFail
- value shouldFailPredicate
- value shouldThrow
- value shouldBe
- value shouldNotBe
- value shouldContain
- value shouldContainPredicate
- value shouldNotContain
- value shouldBeSet
- value shouldNotContainPredicate
- value shouldBeNothing
- value shouldBeJust
- value shouldBeLeft
- value shouldBeRight
- value textShouldContain
- value textShouldNotContain
- Packagesandwich-0.3.1.0
- Exports20
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceExpectations.hs
Manually fail a test or mark as pending
Throws 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
Assert 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
Asserts 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.