test-framework-0.1.2: Framework for running and organising tests, with HUnit and QuickCheck support



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



class (Show i, Show r) => TestResultlike i r | r -> i whereSource

Something like the result of a test: works in concert with Testlike


testSucceeded :: r -> BoolSource


TestResultlike TestCaseRunning TestCaseResult 
TestResultlike PropertyTestCount PropertyResult 

class TestResultlike i r => Testlike i r t | t -> i r, r -> i whereSource

Something test-like in its behaviour


Testlike TestCaseRunning TestCaseResult TestCase 
Testlike PropertyTestCount PropertyResult Property 

type TestName = StringSource

Test names or descriptions. These are shown to the user

type TestTypeName = StringSource

The name of a type of test, such as Properties or Test Cases

data Test Source

Main test data type: build up a list of tests to be run with this.


forall i r t . Testlike i r t => Test TestName t 
TestGroup TestName [Test] 
PlusTestOptions TestOptions Test 

data i :~> f Source


Finished f 
Improving i (i :~> f) 


Functor (:~> i) 

data ImprovingIO i f a Source


timeoutImprovingIO :: Int -> ImprovingIO i f a -> ImprovingIO i f (Maybe a)Source

Given a number of microseconds and an improving IO action, run that improving IO action only for at most the given period before giving up. See also timeout.

maybeTimeoutImprovingIO :: Maybe Int -> ImprovingIO i f a -> ImprovingIO i f (Maybe a)Source

As timeoutImprovingIO, but don't bother applying a timeout to the action if Nothing is given as the number of microseconds to apply the time out for.

newtype K a Source




unK :: a

mappendBy :: Monoid b => (a -> b) -> a -> a -> bSource

orElse :: Maybe a -> a -> aSource

onLeft :: (a -> c) -> (a, b) -> (c, b)Source

onRight :: (b -> c) -> (a, b) -> (a, c)Source

unlinesConcise :: [String] -> StringSource

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

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


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

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

mapAccumLM :: Monad m => (acc -> x -> m (acc, y)) -> acc -> [x] -> m (acc, [y])Source

dropLast :: Int -> [a] -> [a]Source