summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test.mew10
1 files changed, 10 insertions, 0 deletions
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))