Package: lisp-unit

Macro assert-error

Lambda List

assert-error (condition form &rest extras)


condition -- an error condition
form -- a test form
extras -- to be printed if the test fails

Return Value

Return value is unspecified.


This macro tallies a failure if form does not signal an error that is equal to or a subtype of condition-type condition.

Use error to refer to any kind of error. See condition types in the Common Lisp Hyperspec for other possible names.

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


This example asserts that foo is supposed to signal an arithmetic error when passed zero.
  (assert-error 'arithmetic-error (foo 0))   

See also