aboutsummaryrefslogtreecommitdiff
path: root/test/list_test.gleam
diff options
context:
space:
mode:
authorRobert Peterson <robert.peterson@gmail.com>2019-04-16 15:23:19 -0700
committerLouis Pilfold <louis@lpil.uk>2019-04-17 16:12:57 +0100
commit7275a9ef72e79bbf33a47abdb72b4596a10505d8 (patch)
treec3e99d5fc8d705fec0a41a09d5310f0730f8fb7d /test/list_test.gleam
parentf44fc0bae0acb01874bc8226dac6cd53f6087bff (diff)
downloadgleam_stdlib-7275a9ef72e79bbf33a47abdb72b4596a10505d8.tar.gz
gleam_stdlib-7275a9ef72e79bbf33a47abdb72b4596a10505d8.zip
Add list:all
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)
+}