aboutsummaryrefslogtreecommitdiff
path: root/test/list_test.gleam
diff options
context:
space:
mode:
Diffstat (limited to 'test/list_test.gleam')
-rw-r--r--test/list_test.gleam17
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])