tasty-hunit-compat-0.2.0.1: Integration of `HUnit` with `tasty`.
Safe HaskellNone
LanguageHaskell2010

Test.Tasty.HUnit

Contents

Description

HUnit support for tasty.

We don't use `tasty-hunit` directly because it doesn't interoperate properly with other HUnit-based code. Specifically, it defines its own HUnitFailure type and catches exceptions of this type. It doesn't catch HUnit's HUnitFailure, so they are not pretty-printed.

Synopsis

Documentation

testCase :: TestName -> Assertion -> TestTree Source #

Turn an Assertion into a tasty test case

Re-exports

assertFailure #

Arguments

:: HasCallStack 
=> String

A message that is displayed with the assertion failure

-> IO a 

Unconditionally signals that a failure has occurred.

assertBool #

Arguments

:: HasCallStack 
=> String

The message that is displayed if the assertion fails

-> Bool

The condition

-> Assertion 

Asserts that the specified condition holds.

assertEqual #

Arguments

:: (HasCallStack, Eq a, Show a) 
=> String

The message prefix

-> a

The expected value

-> a

The actual value

-> Assertion 

Asserts that the specified actual value is equal to the expected value. The output message will contain the prefix, the expected value, and the actual value.

If the prefix is the empty string (i.e., ""), then the prefix is omitted and only the expected and actual values are output.

(@=?) infix 1 #

Arguments

:: (HasCallStack, Eq a, Show a) 
=> a

The expected value

-> a

The actual value

-> Assertion 

Asserts that the specified actual value is equal to the expected value (with the expected value on the left-hand side).

(@?=) infix 1 #

Arguments

:: (HasCallStack, Eq a, Show a) 
=> a

The actual value

-> a

The expected value

-> Assertion 

Asserts that the specified actual value is equal to the expected value (with the actual value on the left-hand side).

(@?) infix 1 #

Arguments

:: (HasCallStack, AssertionPredicable t) 
=> t

A value of which the asserted condition is predicated

-> String

A message that is displayed if the assertion fails

-> Assertion 

Asserts that the condition obtained from the specified AssertionPredicable holds.

class AssertionPredicable t where #

Used to signify that a data type can be converted to an assertion predicate.

Instances

Instances details
AssertionPredicable Bool 
Instance details

Defined in Test.HUnit.Base

AssertionPredicable t => AssertionPredicable (IO t) 
Instance details

Defined in Test.HUnit.Base

type Assertion = IO () #

When an assertion is evaluated, it will output a message if and only if the assertion fails.

Test cases are composed of a sequence of one or more assertions.

type HasCallStack = ?callStack :: CallStack #

Request a CallStack.

NOTE: The implicit parameter ?callStack :: CallStack is an implementation detail and should not be considered part of the CallStack API, we may decide to change the implementation in the future.

Since: base-4.9.0.0