Module

Test.Unit.Assert

#assert

assert :: String -> Boolean -> Test

Given a failure reason and a boolean, either succeed if the boolean is true, or fail if the boolean is false.

#assertFalse

assertFalse :: String -> Boolean -> Test

The reverse of assert: given a failure reason and a boolean, either succeed if the boolean is false, or fail if the boolean is true.

#expectFailure

expectFailure :: String -> Test -> Test

Expect a test to fail. Given a reason and a test, fail with the given reason if the test succeeds, and succeed if it fails.

#equal

equal :: forall a. Eq a => Show a => a -> a -> Test

Assert that two printable values are equal.

#equal'

equal' :: forall a. Eq a => String -> a -> a -> Test

Assert that two non-printable values are equal, using a provided failure string instead of generating one.

#shouldEqual

shouldEqual :: forall a. Eq a => Show a => a -> a -> Test

shouldEqual is equivalent to equal, with the arguments flipped, for people who prefer the BDD style.

it "should do what I expect of it" do
  result `shouldEqual` "expected result"

Modules