HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduletest-framework-0.8.2.2Haskell2010

Test.Framework.Providers.API

This module exports everything that you need to be able to create your own framework test provider. To create a provider you need to:

  • Create an instance of the Testlike class

  • Create an instance of the TestResultlike class

  • Expose a function that lets people construct Test values using your new instances

  • 7 types
  • 2 classes
  • 25 values
datadata Test
#

Main test data type: builds up a list of tests to be run. Users should use the utility functions in e.g. the test-framework-hunit and test-framework-quickcheck2 packages to create instances of Test, and then build them up into testsuites by using testGroup and lists.

For an example of how to use test-framework, please see http://github.com/batterseapower/test-framework/raw/master/example/Test/Framework/Example.lhs

Constructors

typetype TestName = String
#

Test names or descriptions. These are shown to the user

valuemutuallyExclusive :: Test -> Test
#

Mark all tests in this portion of the tree as mutually exclusive, so only one runs at a time

typetype TestTypeName = String
#

The name of a type of test, such as Properties or "Test Cases". Tests of types of the same names will be grouped together in the test run summary.

classclass (Show i, Show r) => TestResultlike i r | r -> i where
#

Something like the result of a test: works in concert with Testlike. The type parameters are the type that is used for progress reports and the type of the final output of the test respectively.

Methods

classclass TestResultlike i r => Testlike i r t | t -> i r, r -> i where
#

Something test-like in its behaviour. The type parameters are the type that is used for progress reports, the type of the final output of the test and the data type encapsulating the whole potential to do a test respectively.

Methods

Instances1Testlike
newtypenewtype K a
#

Constructors

valueonLeft :: (a -> c) -> (a, b) -> (c, b)
#
valueonRight :: (b -> c) -> (a, b) -> (a, c)
#
valueunlinesConcise :: [String] -> String
#

Like unlines, but does not append a trailing newline if there is at least one line. For example:

unlinesConcise ["A", "B"] == "A\nB"
unlinesConcise [] == ""

Whereas:

unlines ["A", "B"] == "A\nB\n"
unlines [] == ""

This is closer to the behaviour of unwords, which does not append a trailing space.

valuemapAccumLM
  1. :: Monad m
  2. => acc -> x -> m (acc, y)
  3. -> acc
  4. -> [x]
  5. -> m (acc, [y])
#