From 7c7c335386134bc1e45cf62fc2755173facc40cc Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Mon, 7 Nov 2022 23:36:43 +0100 Subject: add fail --- tests/test.mew | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'tests') 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) -- cgit 1.4.1