Permalink
Browse files

Convert expand-output-form to a macro.

  • Loading branch information...
1 parent be2c814 commit f5ea28efcba14c94f4f811543f2cec1192451d6a Thomas M. Hermann committed Apr 21, 2012
Showing with 3 additions and 9 deletions.
  1. +1 −7 internal-test/fundamental-assertions.lisp
  2. +2 −2 lisp-unit.lisp
@@ -146,13 +146,7 @@
("ASSERT-PRINTS"
(assert-prints output form extra1 extra2)
(EXPAND-ASSERT
- :OUTPUT FORM
- (LET* ((#:G1 (MAKE-STRING-OUTPUT-STREAM))
- (*STANDARD-OUTPUT*
- (MAKE-BROADCAST-STREAM *STANDARD-OUTPUT* #:G1)))
- FORM
- (GET-OUTPUT-STREAM-STRING #:G1))
- OUTPUT (EXTRA1 EXTRA2)))
+ :OUTPUT FORM (expand-output-form form) OUTPUT (EXTRA1 EXTRA2)))
("ASSERT-TRUE"
(assert-true form extra1 extra2)
(EXPAND-ASSERT :RESULT FORM FORM T (EXTRA1 EXTRA2))))
View
@@ -181,7 +181,7 @@ For more information, see lisp-unit.html.
`(expand-assert :equal ,form ,form ,expected ,extras :test ,test))
(defmacro assert-prints (output form &rest extras)
- `(expand-assert :output ,form ,(expand-output-form form)
+ `(expand-assert :output ,form (expand-output-form ,form)
,output ,extras))
(defmacro assert-true (form &rest extras)
@@ -198,7 +198,7 @@ For more information, see lisp-unit.html.
`(handler-case ,form
(condition (error) error)))
-(defun expand-output-form (form)
+(defmacro expand-output-form (form)
(let ((out (gensym)))
`(let* ((,out (make-string-output-stream))
(*standard-output* (make-broadcast-stream *standard-output* ,out)))

0 comments on commit f5ea28e

Please sign in to comment.