Module

Test.Unit.Assert

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

#assert Source

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 Source

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 Source

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 Source

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

Assert that two printable values are equal.

#equal' Source

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 Source

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"