Safe Haskell | None |
---|
Test.HUnit.Lang
Contents
Description
This module abstracts the differences between implementations of Haskell (e.g., GHC, Hugs, and NHC).
- type Assertion = IO ()
- assertFailure :: String -> Assertion
- performTestCase :: Assertion -> IO (Maybe (Bool, String))
- data HUnitFailure = HUnitFailure String
Documentation
When an assertion is evaluated, it will output a message if and only if the assertion fails.
Test cases are composed of a sequence of one or more assertions.
Unconditionally signals that a failure has occured. All other assertions can be expressed with the form:
if conditionIsMet then IO () else assertFailure msg
Performs a single test case. The meaning of the result is as follows:
Nothing
- test case success
Just (True, msg)
- test case failure with the given message
Just (False, msg)
- test case error with the given message
Internals
Note: This is not part of the public API! It is exposed so that you can tinker with the internals of HUnit, but do not expect it to be stable!
data HUnitFailure Source
Constructors
HUnitFailure String |