From 98bf60f49ffa34c36fba1ec5eeefb1d96845dfbd Mon Sep 17 00:00:00 2001 From: Marco Baringer Date: Fri, 20 Jan 2006 18:35:10 +0100 Subject: [PATCH] Allow SIGNALS marco to have a description --- src/check.lisp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/check.lisp b/src/check.lisp index b8ec760..ecf6155 100644 --- a/src/check.lisp +++ b/src/check.lisp @@ -193,7 +193,8 @@ Wrapping the TEST form in a NOT simply preducse a negated reason string." :test-expr ',condition) (add-result 'test-passed :test-expr ',condition))) -(defmacro signals (condition &body body) +(defmacro signals ((condition &optional reason-control reason-args) + &body body) "Generates a pass if BODY signals a condition of type CONDITION. BODY is evaluated in a block named NIL, CONDITION is not evaluated." @@ -208,7 +209,9 @@ not evaluated." (block nil ,@body (process-failure - :reason (format nil "Failed to signal a ~S" ',condition) + :reason ,(if reason-control + `(format nil ,reason-control ,@reason-args) + `(format nil "Failed to signal a ~S" ',condition)) :test-expr ',condition) (return-from ,block-name nil)))))) -- 1.7.10.4