Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions src/check.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,15 @@ appropriate."))
initialize args MAKE-INSTANCE-ARGS and add the resulting
object to the list of test results."
(with-run-state (result-list current-test)
(let ((result (apply #'make-instance result-type
(append make-instance-args (list :test-case current-test)))))
(etypecase result
(test-passed (format *test-dribble* "."))
(unexpected-test-failure (format *test-dribble* "X"))
(test-failure (format *test-dribble* "f"))
(test-skipped (format *test-dribble* "s")))
(push result result-list))))
(when (boundp 'current-test)
(let ((result (apply #'make-instance result-type
(append make-instance-args (list :test-case current-test)))))
(etypecase result
(test-passed (format *test-dribble* "."))
(unexpected-test-failure (format *test-dribble* "X"))
(test-failure (format *test-dribble* "f"))
(test-skipped (format *test-dribble* "s")))
(push result result-list)))))

;;;; ** The check operators

Expand Down Expand Up @@ -187,10 +188,14 @@ REASON-ARGS is provided, is generated based on the form of TEST:
effective-test test
default-reason-args (list "~2&~S~2% was NIL." `',test)))))
`(let ,bindings
(if ,effective-test
(add-result 'test-passed :test-expr ',test)
(process-failure ',test
,@(or reason-args default-reason-args)))))))
(cond
(,effective-test
(add-result 'test-passed :test-expr ',test)
t)
(t
(process-failure ',test
,@(or reason-args default-reason-args))
nil))))))

;;;; *** Other checks

Expand Down