test package:chell
Define a test, with the given name and implementation.
A
Test is, essentially, an IO action that returns a
TestResult. Tests are aggregated into suites (see
Suite).
Get the name a test was given when it was defined; see
test.
Get the RNG seed for this test run. The seed is generated once, in
defaultMain, and used for all tests. It is also logged to
reports using a note.
When using
defaultMain, users may specify a seed using the
--seed command-line option.
testOptionSeed is a field accessor, and can be used to update a
TestOptions value.
An optional timeout, in milliseconds. Tests which run longer than this
timeout will be aborted.
When using
defaultMain, users may specify a timeout using the
--timeout command-line option.
testOptionTimeout is a field accessor, and can be used to
update a
TestOptions value.
The test aborted with an error message, and generated the given notes.
The test failed, generating the given notes and failures.
Test options are passed to each test, and control details about how
the test should be run.
The test passed, and generated the given notes.
The result of running a test.
To support future extensions to the testing API, any users of this
module who pattern-match against the
TestResult constructors
should include a default case. If no default case is provided, a
warning will be issued.
Register an IO action to be run after the test completes. This action
will run even if the test failed or aborted.
Default test options.
$ ghci
Prelude> import Test.Chell
Test.Chell> testOptionSeed defaultTestOptions
0
Test.Chell> testOptionTimeout defaultTestOptions
Nothing
Run a test, wrapped in error handlers. This will return
TestAborted if the test throws an exception or times out.
Get the full list of tests contained within this
Suite. Each
test is given its full name within the test hierarchy, where names are
separated by periods.
$ ghci chell-example.hs
Ok, modules loaded: Main.
*Main> suiteTests tests_Math
[Test "math.addition",Test "math.subtraction"]