Use new ASSERT-ERROR.
authorChris Hanson <org/chris-hanson/cph>
Mon, 24 May 2010 05:12:54 +0000 (22:12 -0700)
committerChris Hanson <org/chris-hanson/cph>
Mon, 24 May 2010 05:12:54 +0000 (22:12 -0700)
tests/runtime/test-regsexp.scm

index 8f3a9c86f24e2605838b160d8d77245287125e99..1b7bb04d48bf7fe8358c52bc962f97d8240a150a 100644 (file)
@@ -31,15 +31,15 @@ USA.
   (regsexp-match-string (compile-regsexp pattern) string))
 
 (define ((match-string-test pattern string expected))
-  (let ((result (ignore-errors (lambda () (match-string pattern string)))))
-    (if (condition? result)
-       (if (and (eq? expected 'PATTERN-ERROR)
-                (condition-of-type? result condition-type:compile-regsexp))
-           #f
-           (signal-condition result))
-       (assert-equal result
+  (let ((thunk (lambda () (match-string pattern string)))
+       (expr `(match-string ',pattern ,string)))
+    (if (eq? expected 'PATTERN-ERROR)
+       (assert-error thunk
+                     (list condition-type:compile-regsexp)
+                     'EXPRESSION error)
+       (assert-equal (thunk)
                      expected
-                     'EXPRESSION `(match-string ',pattern ,string)))))
+                     'EXPRESSION expr))))
 
 (define (match-strings-test pattern entries)
   (map (lambda (p)