HUnit-1.2.0.3: A unit testing framework for Haskell

Test.HUnit.Base

Documentation

type Assertion = IO ()

assertString :: String -> Assertion

assertBool :: String -> Bool -> Assertion

assertEqual :: (Eq a, Show a) => String -> a -> a -> Assertion

class Assertable t where

Methods

assert :: t -> Assertion

Instances

class ListAssertable t where

Methods

listAssert :: [t] -> Assertion

Instances

type AssertionPredicate = IO Bool

(@?) :: AssertionPredicable t => t -> String -> Assertion

(@=?) :: (Eq a, Show a) => a -> a -> Assertion

(@?=) :: (Eq a, Show a) => a -> a -> Assertion

data Test

Constructors

TestCase Assertion 
TestList [Test] 
TestLabel String Test 

Instances

data Node

Constructors

ListItem Int 
Label String 

Instances

Eq Node 
Read Node 
Show Node 

type Path = [Node]

class Testable t where

Methods

test :: t -> Test

Instances

(~?) :: AssertionPredicable t => t -> String -> Test

(~=?) :: (Eq a, Show a) => a -> a -> Test

(~?=) :: (Eq a, Show a) => a -> a -> Test

(~:) :: Testable t => String -> t -> Test

data Counts

Constructors

Counts 

Fields

cases :: Int
 
tried :: Int
 
errors :: Int
 
failures :: Int
 

Instances

Eq Counts 
Read Counts 
Show Counts 

data State

Constructors

State 

Fields

path :: Path
 
counts :: Counts
 

Instances

Eq State 
Read State 
Show State 

type ReportStart us = State -> us -> IO us

type ReportProblem us = String -> State -> us -> IO us

performTest :: ReportStart us -> ReportProblem us -> ReportProblem us -> us -> Test -> IO (Counts, us)