ContentsIndex
Test.MiniUnit
Portabilityportable
Stabilityexperimental
Maintaineroleg@pobox.com, alistair@abayley.org
Contents
Primary API
Exposed for self-testing only; see Test.MiniUnitTest
Description
This is just a simple one-module unit test framework, with the same API as Test.HUnit (albeit with a lot of stuff missing). We use it because it works in CaughtMonadIO instead of IO (and also because I couldn't convert Test.HUnit to use CaughtMonadIO).
Synopsis
runTestTT :: CaughtMonadIO m => String -> [m ()] -> m Int
assertFailure :: CaughtMonadIO m => String -> m ()
assertBool :: CaughtMonadIO m => String -> Bool -> m ()
assertString :: CaughtMonadIO m => String -> m ()
assertEqual :: (Eq a, Show a, CaughtMonadIO m) => String -> a -> a -> m ()
data TestResult
= TestSuccess
| TestFailure String
| TestException String
throwUserError :: CaughtMonadIO m => String -> m ()
runSingleTest :: CaughtMonadIO m => m () -> m TestResult
Primary API
runTestTT :: CaughtMonadIO m => String -> [m ()] -> m Int
Return 0 if everything is rosy, 1 if there were assertion failures (but no exceptions), 2 if there were any exceptions. You could use this return code as the return code from your program, if you're driving from the command line.
assertFailure :: CaughtMonadIO m => String -> m ()
assertBool :: CaughtMonadIO m => String -> Bool -> m ()
assertString :: CaughtMonadIO m => String -> m ()
assertEqual
:: (Eq a, Show a, CaughtMonadIO m)
=> Stringmessage preface
-> aexpected
-> aactual
-> m ()
Exposed for self-testing only; see Test.MiniUnitTest
data TestResult
Constructors
TestSuccess
TestFailure String
TestException String
show/hide Instances
throwUserError :: CaughtMonadIO m => String -> m ()
runSingleTest :: CaughtMonadIO m => m () -> m TestResult
Produced by Haddock version 0.7