From 3779df17f2726c2ad4c6904016f2b27c5049ed0d Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Fri, 18 Nov 2022 00:04:05 +0100 Subject: add odometer/cross-product --- tests/test.mew | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests') 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-> -- cgit 1.4.1