Module

Test.Unit.Assert

Package
purescript-test-unit
Repository
bodil/purescript-test-unit

#assert Source

assert :: forall e. String -> Boolean -> Test e

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

#assertFalse Source

assertFalse :: forall e. String -> Boolean -> Test e

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 Source

expectFailure :: forall e. String -> Test e -> Test e

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 Source

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

Assert that two printable values are equal.

#equal' Source

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

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

#shouldEqual Source

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

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"