X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcheck.lisp;h=cdf57fdd8d003daf4c8e607b268f16d7671eabb9;hb=e7e3b44fc7b51a80f364936fa428fe86862d999a;hp=c2f4ee78229684c9047a4e12bb8adc82da194604;hpb=a2e8d66cb3a532f5d55ca6175bd48fd40db5674b;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)