X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcheck.lisp;fp=src%2Fcheck.lisp;h=cdf57fdd8d003daf4c8e607b268f16d7671eabb9;hb=325262d82eb9620b042e4c2bad38eb5dd47c03ef;hp=c2f4ee78229684c9047a4e12bb8adc82da194604;hpb=660083a151da6492d44a5e21113d2c6064ea7817;p=fiveam.git diff --git a/src/check.lisp b/src/check.lisp index c2f4ee7..cdf57fd 100644 --- a/src/check.lisp +++ b/src/check.lisp @@ -229,13 +229,16 @@ REASON-ARGS is provided, is generated based on the form of TEST: failure otherwise. Like IS-TRUE, and unlike IS, IS-FALSE does not inspect CONDITION to determine what reason to give it case of test failure" - `(if ,condition - (process-failure - :reason ,(if reason-args - `(format nil ,@reason-args) - `(format nil "~S returned a true value" ',condition)) - :test-expr ',condition) - (add-result 'test-passed :test-expr ',condition))) + + (with-unique-names (value) + `(let ((,value ,condition)) + (if ,value + (process-failure + :reason ,(if reason-args + `(format nil ,@reason-args) + `(format nil "~S returned the value ~S, which is true" ',condition ,value )) + :test-expr ',condition) + (add-result 'test-passed :test-expr ',condition))))) (defmacro signals (condition-spec &body body)