AC-MiniTest-1.1.1: A simple test framework.

Safe HaskellSafe-Infered

Test.AC.Class.Eq

Description

Properties for testing that instances of the Eq class perform correctly.

p_reflexive, p_symmetric and p_transitive check the basic properties of an equity relation. In other words, they test the == method. p_not_equal checks for the extraordinarily unlikely case of == and /= not agreeing on equity. (The default implementation of /= automatically guarantees that this test will pass, and that's what most people presumably use.)

Synopsis

Documentation

p_reflexive :: (Show x, Eq x) => x -> TestSource

Check that x == x.

p_symmetric :: (Show x, Eq x) => x -> x -> TestSource

Check that if x == y then y == x as well.

p_transitive :: (Show x, Eq x) => x -> x -> x -> TestSource

Check that if x == y and y == z then x == z.

p_not_equal :: (Show x, Eq x) => x -> x -> TestSource

Check that x /= y is the same as not (x == y).

p_Eq :: (Show x, Eq x) => [x] -> TestSource

Given a list of distinct values, perform all applicable tests on all possible combinations of inputs. (If the inputs are not distinct, some redundant tests are performed.)