From a69799aa42d56cb31328f350eb8c2c95a629f505 Mon Sep 17 00:00:00 2001 From: Grazfather Date: Fri, 3 Dec 2021 20:44:35 -0500 Subject: [PATCH] Add tests for mapping different length sequences --- test/suite0001.janet | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/suite0001.janet b/test/suite0001.janet index 7501f37a..958449ce 100644 --- a/test/suite0001.janet +++ b/test/suite0001.janet @@ -288,6 +288,11 @@ (assert (deep= (map + [1 2 3] [10 20 30] [100 200 300] [1000 2000 3000]) @[1111 2222 3333])) (assert (deep= (map + [1 2 3] [10 20 30] [100 200 300] [1000 2000 3000] [10000 20000 30000]) @[11111 22222 33333])) +# Mapping uses the shortest sequence +(assert (deep= (map + [1 2 3 4] [10 20 30]) @[11 22 33])) +(assert (deep= (map + [1 2 3 4] [10 20 30] [100 200]) @[111 222])) +(assert (deep= (map + [1 2 3 4] [10 20 30] [100 200] [1000]) @[1111])) + # Sort function (assert (deep= (range 99)