From: Chris Hanson Date: Mon, 31 May 2010 00:37:11 +0000 (-0700) Subject: Improve test reporting for errors. Add boolean equality assertions. X-Git-Tag: 20100708-Gtk~43 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=7da7c5ecb22c2f37fa7fb735b5fdb61d7dbc93da;p=mit-scheme.git Improve test reporting for errors. Add boolean equality assertions. --- diff --git a/tests/unit-testing.scm b/tests/unit-testing.scm index 1b1d2ef58..1e95c9a1e 100644 --- a/tests/unit-testing.scm +++ b/tests/unit-testing.scm @@ -248,6 +248,11 @@ USA. (define (report-failure failure port) (cond ((failure-property 'CONDITION failure) => (lambda (p) + (let ((expr (failure-property 'EXPRESSION failure))) + (if expr + (begin + (write-expr-property #f expr port) + (write-string " " port)))) (write-string "failed with error: " port) (write-condition-report (cdr p) port))) ((failure-feature 'RESULT failure) @@ -369,6 +374,10 @@ USA. (define-for-tests assert-> (binary-assertion >)) (define-for-tests assert->= (binary-assertion >=)) +(define-for-tests assert-boolean-= (binary-assertion boolean=?)) +(define-for-tests assert-boolean-!= + (binary-assertion (lambda (x y) (not (boolean=? x y))))) + (define-for-tests (assert-error thunk condition-types . properties) (call-with-current-continuation (lambda (k)