Package: lisp-unit

Macro assert-equality

Lambda List

assert-equality (test expected form &rest extras)

Arguments

test -- a predicate with two arguments
expected -- the expected value
form -- an test form
extras -- to be printed if the test fails

Return Value

Return value is unspecified.

Details

Assertion with a user defined predicate.

These macros tally a failure if the value expected is not equal to the result returned by form, using the specified equality predicate test.

In general, assert-equal is used for most tests. But any binary predicate can be used, with assert-equality, e.g.,
  (assert-equality #'unordered-equal 
                   '(a b c) (unique-atoms '((b c) a ((b a) c))))   
Besides the predicate unordered-equal, the predicates set-equal and logically-equal might be useful.

See assert-eq for a detailed description of assert macros.
 

See also