Skip to content

Commit fa9b115

Browse files
authored
Merge pull request #394 from Affonso-Gui/fix-unittest-assert
Fix variable capture in unittest.l
2 parents f70dd58 + 3cf71d2 commit fa9b115

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

lib/llib/unittest.l

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,17 @@
232232
(trace ,name))))
233233

234234
(defmacro assert (pred &optional (message "") &rest args)
235-
(let
236-
((ret (gensym)))
237-
`(let* (failure (ret ,pred))
238-
;; lisp::step could not work with macros..
239-
;; (if (and (listp ',pred) (functionp (car ',pred)))
240-
;; (setq ret (lisp::step ,pred))
241-
;; (setq ret ,pred))
242-
;;
243-
(if (not ret)
244-
;; escape <> for xml
245-
(send *unit-test* :increment-failure ',pred (format nil ,message ,@args)
246-
(escape-xml-string (subseq (send *error-output* :buffer) 0 (or (position 0 (send *error-output* :buffer)) (length (send *error-output* :buffer)))))))
247-
)))
235+
`(let (failure (ret ,pred))
236+
;; lisp::step could not work with macros..
237+
;; (if (and (listp ',pred) (functionp (car ',pred)))
238+
;; (setq ret (lisp::step ,pred))
239+
;; (setq ret ,pred))
240+
;;
241+
(if (not ret)
242+
;; escape <> for xml
243+
(send *unit-test* :increment-failure ',pred (format nil ,message ,@args)
244+
(escape-xml-string (subseq (send *error-output* :buffer) 0 (or (position 0 (send *error-output* :buffer)) (length (send *error-output* :buffer)))))))
245+
))
248246

249247

250248
t))

0 commit comments

Comments
 (0)