aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSebastian <s@porto5.com>2020-10-14 16:05:24 +1100
committerLouis Pilfold <louis@lpil.uk>2020-10-17 13:33:20 +0200
commit1489e38aaa076112fe580cd096e4c827304d2bd3 (patch)
treef9b81627920250a85033ead47a583af13898bebf /test
parent42c75c7c9594a068d72b75390b2a47e17544d087 (diff)
downloadgleam_stdlib-1489e38aaa076112fe580cd096e4c827304d2bd3.tar.gz
gleam_stdlib-1489e38aaa076112fe580cd096e4c827304d2bd3.zip
Add result.all
Diffstat (limited to 'test')
-rw-r--r--test/gleam/result_test.gleam10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/gleam/result_test.gleam b/test/gleam/result_test.gleam
index 4abc983..1c585b5 100644
--- a/test/gleam/result_test.gleam
+++ b/test/gleam/result_test.gleam
@@ -118,3 +118,13 @@ pub fn or_test() {
|> result.or(Error("Error 2"))
|> should.equal(Error("Error 2"))
}
+
+pub fn all_test() {
+ [Ok(1), Ok(2), Ok(3)]
+ |> result.all
+ |> should.equal(Ok([1, 2, 3]))
+
+ [Ok(1), Error("a"), Error("b"), Ok(3)]
+ |> result.all
+ |> should.equal(Error("a"))
+}