diff options
author | Brett Snyder <bsnyder788@gmail.com> | 2019-05-10 11:26:59 -0500 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2019-05-10 17:26:59 +0100 |
commit | 83525b26f33d906284c1d5637aafe578d32704ba (patch) | |
tree | ffe908218a8dc1723f0e064ce3fdd91011036ec0 /test | |
parent | d2823c67e674358a1610f24afa584ddf5f31874d (diff) | |
download | gleam_stdlib-83525b26f33d906284c1d5637aafe578d32704ba.tar.gz gleam_stdlib-83525b26f33d906284c1d5637aafe578d32704ba.zip |
list:strict_zip (#167)
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 81f2427..779ba7b 100644 --- a/test/list_test.gleam +++ b/test/list_test.gleam @@ -204,6 +204,23 @@ pub fn zip_test() { |> expect:equal(_, [{5, 1}, {6, 2}]) } +pub fn strict_zip_test() { + list:strict_zip([], [1, 2, 3]) + |> expect:is_error + + list:strict_zip([1, 2], []) + |> expect:is_error + + list:zip([1, 2, 3], [4, 5, 6]) + |> expect:equal(_, [{1, 4}, {2, 5}, {3, 6}]) + + list:strict_zip([5, 6], [1, 2, 3]) + |> expect:is_error + + list:strict_zip([5, 6, 7], [1, 2]) + |> expect:is_error +} + pub fn intersperse_test() { list:intersperse([1, 2, 3], 4) |> expect:equal(_, [1, 4, 2, 4, 3]) |