Allow assert-error to be used without explicit error conditions.
authorChris Hanson <org/chris-hanson/cph>
Fri, 20 Jan 2017 09:45:51 +0000 (01:45 -0800)
committerChris Hanson <org/chris-hanson/cph>
Fri, 20 Jan 2017 09:45:51 +0000 (01:45 -0800)
tests/unit-testing.scm

index 0f4287dca28bed942b5965a42c5f435e37f2d165..171635ed73d3725dd1c74f2d33f0051a1261251d 100644 (file)
@@ -417,12 +417,15 @@ USA.
             'EQUALITY-PREDICATE =
             properties)))
 \f
-(define-for-tests (assert-error thunk condition-types . properties)
+(define-for-tests (assert-error thunk #!optional condition-types . properties)
   (call-with-current-continuation
    (lambda (k)
      (apply fail
            'RESULT-OBJECT
-           (bind-condition-handler condition-types
+           (bind-condition-handler
+               (if (default-object? condition-types)
+                   (list condition-type:error)
+                   condition-types)
                (lambda (condition)
                  condition             ;ignore
                  (k #f))