(zip [l1] [l2])
This commit is contained in:
@@ -114,11 +114,20 @@
|
||||
(defun myTypeCheck []
|
||||
(the Int 5))
|
||||
|
||||
(defun myGroups1 []
|
||||
(groups [1 2 3 4] 2))
|
||||
(defun _testGroups []
|
||||
(Assert.equals (.toString [[1 2] [3 4]]) (.toString (groups [1 2 3 4] 2)))
|
||||
(Assert.equals (.toString [[1 2 3] [4]]) (.toString (groups [1 2 3 4] 3 Keep)))
|
||||
(try (begin (groups [1 2 3 4] 3 Throw) (Assert.fail))
|
||||
(catch [error] (Assert.pass))))
|
||||
|
||||
(defun myGroups2 []
|
||||
(groups [1 2 3 4] 3 Keep))
|
||||
(defun _testZip []
|
||||
(Assert.equals (.toString [[1 2] [3 4]]) (.toString (zip [1 3] [2 4] Throw)))
|
||||
(Assert.equals (.toString [[1 2] [3 null]]) (.toString (zip [1 3] [2] Keep)))
|
||||
(Assert.equals (.toString [[1 2] [null 4]]) (.toString (zip [1 null] [2 4] Keep)))
|
||||
(try (begin (zip [1 3] [2] Throw) (Assert.fail))
|
||||
(catch [error] (Assert.pass)))
|
||||
(try (begin (zip [1] [2 4] Throw) (Assert.fail))
|
||||
(catch [error] (Assert.pass))))
|
||||
|
||||
(defun _testLet []
|
||||
(let [a 5
|
||||
|
Reference in New Issue
Block a user