enumerate. Close #28

This commit is contained in:
2021-07-24 12:22:20 -06:00
parent d5208545fe
commit b02e1f34cc
4 changed files with 22 additions and 6 deletions

View File

@@ -135,6 +135,10 @@ class BasicTestCase extends Test {
Assert.equals(5, BasicTestCase.myTypeCheck());
}
function testEnumerate() {
_testEnumerate();
}
function testGroups() {
_testGroups();
}

View File

@@ -130,6 +130,10 @@
(Assert.equals (.toString [[1 2]]) (.toString (zipDrop [1 2 3 4] [2])))
(Assert.equals (.toString [[1 2] [3 4]]) (.toString (apply zipThrow [[1 3] [2 4]]))))
(defun _testEnumerate []
(Assert.equals "[[0,a],[1,b]]" (.toString (enumerate ["a" "b"])))
(Assert.equals "[[1,a],[2,b]]" (.toString (enumerate ["a" "b"] 1))))
(defun _testLet []
(let [a 5
b 6