Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Running tests. To check a TestTree
in a REPL, use
quickCheckTree
; to check a QuickCheck Testable
, just use
quickCheck
and the similar functions in
Test.QuickCheck. The other functions in this module will be more
useful for checking from within a compiled test program.
The QuickCheck docs in Test.QuickCheck contain warnings about how
type defaulting in GHCi can cause types to silently default to
()
; all those warnings also apply to use of the functions in this
module. Although QuickCheck has some Template Haskell to help with
this, Quickpull currently does not. You don't have to worry about
this in non-interactive use, as the defaulting rules are more
strict and, with warnings on, GHC will warn you when it defaults a
type.
- quickCheckTree :: TestTree -> IO ()
- treeWithResult :: (forall a. Testable a => a -> IO Result) -> TestTree -> IO [Result]
- decreeWithResult :: (forall a. Testable a => a -> IO Result) -> Decree -> IO [Result]
- seeDecree :: (Decree -> forall a. Testable a => a -> IO Result) -> [Decree] -> IO [[Result]]
- defaultMain :: [Decree] -> IO ()
- defaultMainWith :: Args -> [Decree] -> IO ()
- summarize :: [Result] -> Summary
- exitCode :: Summary -> ExitCode
Testing TestTree
quickCheckTree :: TestTree -> IO () Source
Checks a TestTree
and prints the result to standard output.
Intended for use in a REPL; however, the QuickCheck docs in
Test.QuickCheck contain warnings about how type defaulting in
GHCi can cause types to silently default to ()
; all those
warnings also apply to use of this function.
Testing Decree
s
seeDecree :: (Decree -> forall a. Testable a => a -> IO Result) -> [Decree] -> IO [[Result]] Source
Tests each Decree
using a custom function that you specify;
this allows you to vary the test depending on what's in the
Decree
. Each Decree
returns a list of Result
(a Single
returns a single Result
, while a Multi
returns a Result
for
each test in the tree.) The tests are printed to standard output
as they run, in addition to returning the Result
.
Default main functions
defaultMain :: [Decree] -> IO () Source
Tests each Decree
and prints the results to standard output.
Exits successfully if all tests succeeded; otherwise, exits
unsuccessfully.
Not recommended for REPL use as this function will either kill your REPL when it's done or, in the case of recent GHC versions, issue an exception.
defaultMainWith :: Args -> [Decree] -> IO () Source
Like defaultMain
but allows you to pass arguments to the
QuickCheck driver.
Not recommended for REPL use as this function will either kill your REPL when it's done or, in the case of recent GHC versions, issue an exception.