Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun report-result (result form)
- (format t "~:[FAIL~;pass~] ... ~a~%" result form)
- result)
- (defmacro combine-results (&body forms)
- (with-gensyms (result)
- `(let ((,result t))
- ,@(loop for f in forms collect `(unless ,f (serf ,result nil)))
- ,result)))
- (defmacro check (&body forms)
- `(combine-results
- ,@(loop for f in forms collect `(report-result ,f ',f))))
- (defun test-+ ()
- (check
- (= (+ 1 2) 3)
- (= (+ 1 2 3) 6)
- (= (+ -1 -3) -4)))
Add Comment
Please, Sign In to add comment