summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test.mew16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/test.mew b/tests/test.mew
index 903620c..98ad5fa 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -1,6 +1,7 @@
 (import mew
         test
-        (chicken port))
+        (chicken port)
+        (chicken condition))
 
 (test-group "negate"
   (test #t ((negate not) #t))
@@ -477,4 +478,17 @@
   (test 3 ((proj 2) 1 2 3))
   (test-error ((proj 4) 1 2 3)))
 
+(test-group "fail"
+  (test #t (condition-case (fail "foo")
+             ((exn) #t)
+             (() #f)))
+  (test #t (condition-case (fail '(florp) "foo")
+             ((florp) #t)
+             (() #f)))
+  (test #t (condition-case (fail '(florp flurp) "foo")
+             ((florp flurp) #t)
+             (() #f)))
+  (test "foo 1 2" (condition-case (fail "foo ~a ~a" 1 2)
+                    (e (exn) (get-condition-property e 'exn 'message)))))
+
 (test-exit)