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.gleam11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/list_test.gleam b/test/list_test.gleam
index c0a16ae..a24c7b8 100644
--- a/test/list_test.gleam
+++ b/test/list_test.gleam
@@ -162,3 +162,14 @@ pub fn find_test() {
|> list:find(_, f)
|> expect:is_error
}
+
+pub fn all_test() {
+ list:all([1,2,3,4,5], fn(x) { x > 0 })
+ |> expect:equal(_, True)
+
+ list:all([1,2,3,4,5], fn(x) { x < 0 })
+ |> expect:equal(_, False)
+
+ list:all([], fn(_) { False })
+ |> expect:equal(_, True)
+}