summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-11-03 20:26:47 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-11-03 20:26:47 +0100
commit3e02069ff0df373cc3211d354429f6f65c71cf72 (patch)
tree8b3c7c573eb8d67107a0730a92e412089e073feb /tests
parent86844e3db77c52cfff703c6e31ce7877e3fe0bba (diff)
downloadmew-3e02069ff0df373cc3211d354429f6f65c71cf72.tar.gz
mew-3e02069ff0df373cc3211d354429f6f65c71cf72.tar.xz
mew-3e02069ff0df373cc3211d354429f6f65c71cf72.zip
add andloc
Diffstat (limited to 'tests')
-rw-r--r--tests/test.mew24
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/test.mew b/tests/test.mew
index 4fa0351..f8ee39d 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -141,12 +141,28 @@
 (test-group "loc"
   (test 42 (loc () 42))
   (test 42 (loc (a (* 6 7))
-              a))
+             a))
   (test 42 (loc (a 6
-                  b (* a 7))
-              b))
+                 b (* a 7))
+             b))
   (test 42 (loc ((a . b) '(42 2 3))
-              a)))
+             a)))
+
+(test-group "andloc"
+  (test 42 (andloc () 42))
+  (test 42 (andloc (a (* 6 7))
+             a))
+  (test 42 (andloc (a 6
+                    b (* a 7))
+             b))
+  (test #t (andloc (a 6
+                    c (even? a)
+                    b (* a 7))
+             c))
+  (test #f (andloc (a 6
+                    _ (odd? a)
+                    b (* a 7))
+             a)))
 
 (test-group "fun*"
   (test 42 ((fun* ((a . b)) (* a b)) (cons 6 7))))