make-log-reporter
full-reporter
user-reporter
- format-test-name
-
- ;; Noticing whether an error occurs.
- signals-error? signals-error?*)
+ format-test-name)
;;;; If you're using Emacs's Scheme mode:
(apply full-reporter result name args)))
(set! default-reporter full-reporter)
-
-\f
-;;;; Detecting whether errors occur
-
-;;; (signals-error? KEY BODY ...)
-;;; Evaluate the expressions BODY ... . If any errors occur, return #t;
-;;; otherwise, return #f.
-;;;
-;;; KEY indicates the sort of errors to look for; it can be a symbol,
-;;; indicating that only errors with that name should be caught, or
-;;; #t, meaning that any kind of error should be caught.
-(defmacro signals-error? key-and-body
- `(signals-error?* ,(car key-and-body)
- (lambda () ,@(cdr key-and-body))))
-
-;;; (signals-error?* KEY THUNK)
-;;; Apply THUNK, catching errors. If any errors occur, return #t;
-;;; otherwise, return #f.
-;;;
-;;; KEY indicates the sort of errors to look for; it can be a symbol,
-;;; indicating that only errors with that name should be caught, or
-;;; #t, meaning that any kind of error should be caught.
-(define (signals-error?* key thunk)
- (catch key
- (lambda () (thunk) #f)
- (lambda args #t)))