summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-11-18 00:04:05 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-11-18 00:04:05 +0100
commit3779df17f2726c2ad4c6904016f2b27c5049ed0d (patch)
tree920483986a077e492debd83a767b5766e420546c /tests
parentbeb92ad9009f6b6a338430ba137e33201cca2230 (diff)
downloadmew-3779df17f2726c2ad4c6904016f2b27c5049ed0d.tar.gz
mew-3779df17f2726c2ad4c6904016f2b27c5049ed0d.tar.xz
mew-3779df17f2726c2ad4c6904016f2b27c5049ed0d.zip
add odometer/cross-product
Diffstat (limited to 'tests')
-rw-r--r--tests/test.mew13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test.mew b/tests/test.mew
index b08bfd6..328e282 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -357,6 +357,19 @@
   (test 3 (final (generator 1 2 3)))
   (test #t (void? (final (generator)))))
 
+(test-group "odometer"
+  (test '((0 0) (0 1) (0 2) (1 0) (1 1) (1 2)) (into '() (odometer 2 3)))
+  (test '((0) (1) (2)) (into '() (odometer 3)))
+  (test '() (into '() (odometer)))
+  (test 1365 (len (odometer 3 5 7 13))))
+
+(test-group "cross-product"
+  (test '((a X) (a Y) (b X) (b Y) (c X) (c Y))
+        (into '() (cross-product '(a b c) '(X Y))))
+  (test '((a) (b) (c))
+        (into '() (cross-product '(a b c))))
+  (test '() (into '() (cross-product))))
+
 ; ->
 
 ; fun->