summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-11-07 23:36:43 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-11-07 23:36:43 +0100
commit7c7c335386134bc1e45cf62fc2755173facc40cc (patch)
treeba70384701e9c63bbbe7ada638eb7a2b1f056e94 /tests
parentf7c45171f5ef9a82612e8166184559b8ab781c4f (diff)
downloadmew-7c7c335386134bc1e45cf62fc2755173facc40cc.tar.gz
mew-7c7c335386134bc1e45cf62fc2755173facc40cc.tar.xz
mew-7c7c335386134bc1e45cf62fc2755173facc40cc.zip
add fail
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)