tasty-0.3.1: Modern and extensible testing framework

Safe HaskellNone



API for test providers



class Typeable t => IsTest t whereSource

The interface to be implemented by a test provider.

The type t is the concrete representation of the test which is used by the provider.




:: OptionSet


-> t

the test to run

-> (Progress -> IO ())

a callback to report progress

-> IO Result 

Run the test

testOptions :: Tagged t [OptionDescription]Source

The list of options that affect execution of tests of this type

data Result Source

A test result




resultSuccessful :: Bool

resultSuccessful should be True for a passed test and False for a failed one.

resultDescription :: String

resultDescription may contain some details about the test. For a passed test it's ok to leave it empty. Providers like SmallCheck and QuickCheck use it to provide information about how many tests were generated.

For a failed test, resultDescription should typically provide more information about the failure.

data Progress Source

Test progress information.

This may be used by a runner to provide some feedback to the user while a long-running test is executing.




progressText :: String

textual information about the test's progress

progressPercent :: Float

progressPercent should be a value between 0 and 1. If it's impossible to compute the estimate, use 0.

type TestName = StringSource

The name of a test or a group of tests

data TestTree Source

The main data structure defining a test suite.

It consists of individual test cases and properties, organized in named groups which form a tree-like hierarchy.

There is no generic way to create a test case. Instead, every test provider (tasty-hunit, tasty-smallcheck etc.) provides a function to turn a test case into a TestTree.

Groups can be created using testGroup.

singleTest :: IsTest t => TestName -> t -> TestTreeSource

Convert a test to a leaf of the TestTree