From 909cf1ba9001f52afbbb6f7cfb6c919869c068ac Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Mon, 2 Jan 2023 18:58:35 +0100 Subject: add inc!, dec! --- tests/test.mew | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/test.mew b/tests/test.mew index b7e5da7..44fdb95 100644 --- a/tests/test.mew +++ b/tests/test.mew @@ -97,6 +97,11 @@ (test 3/2 (inc 1/2)) (test-error (inc "foo"))) +(test-group "inc!" + (test 7 (loc (x 5) (inc! x) (inc! x) x)) + (test 6 (loc (x 5) (inc! x))) + (test 7 (loc (x 5) (inc! x 2)))) + (test-group "dec" (test 4 (dec 5)) (test -2 (dec -1)) @@ -104,6 +109,11 @@ (test -1/2 (dec 1/2)) (test-error (dec "foo"))) +(test-group "dec!" + (test 5 (loc (x 7) (dec! x) (dec! x) x)) + (test 5 (loc (x 6) (dec! x))) + (test 5 (loc (x 7) (dec! x 2)))) + (test-group "boolean" (test #f (boolean #f)) (test #t (boolean #t)) -- cgit 1.4.1