diff options
author | Robert Peterson <robert.peterson@gmail.com> | 2019-04-16 17:00:25 -0700 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2019-04-17 16:12:57 +0100 |
commit | 6ae1f2cf51868e2bd05ae47ec1cf09344dc1393b (patch) | |
tree | 57dc58419990cc6219be353f6f0b758024112ff2 /test | |
parent | 933dc2c4b723ad45d96a7bfc6fb0fb4651550d05 (diff) | |
download | gleam_stdlib-6ae1f2cf51868e2bd05ae47ec1cf09344dc1393b.tar.gz gleam_stdlib-6ae1f2cf51868e2bd05ae47ec1cf09344dc1393b.zip |
Add list:zip
Diffstat (limited to 'test')
-rw-r--r-- | test/list_test.gleam | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/list_test.gleam b/test/list_test.gleam index 2afd9e2..e7cd786 100644 --- a/test/list_test.gleam +++ b/test/list_test.gleam @@ -184,3 +184,20 @@ pub fn any_test() { list:any([], fn(_) { False }) |> expect:equal(_, False) } + +pub fn zip_test() { + list:zip([], [1,2,3]) + |> expect:equal(_, []) + + list:zip([1,2], []) + |> expect:equal(_, []) + + list:zip([1,2,3], [4,5,6]) + |> expect:equal(_, [{1,4}, {2,5}, {3,6}]) + + list:zip([5,6], [1,2,3]) + |> expect:equal(_, [{5,1}, {6,2}]) + + list:zip([5,6,7], [1,2]) + |> expect:equal(_, [{5,1}, {6,2}]) +} |