aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Doneth <doneth7@gmail.com>2021-12-03 21:20:18 -0500
committerLouis Pilfold <louis@lpil.uk>2021-12-04 10:53:20 +0000
commitf14accf184cad3ae5dbc8a9b265add0fc87c604e (patch)
treed2a9dcc106331c791c7d1c7a74ec524b57ea0618 /test
parent32e43bb7fccdf112280e4d65df786ac556d7340f (diff)
downloadgleam_stdlib-f14accf184cad3ae5dbc8a9b265add0fc87c604e.tar.gz
gleam_stdlib-f14accf184cad3ae5dbc8a9b265add0fc87c604e.zip
Correct accumulator argument position in documentation
Diffstat (limited to 'test')
-rw-r--r--test/gleam/iterator_test.gleam2
-rw-r--r--test/gleam/list_test.gleam4
2 files changed, 3 insertions, 3 deletions
diff --git a/test/gleam/iterator_test.gleam b/test/gleam/iterator_test.gleam
index 5601672..d8da969 100644
--- a/test/gleam/iterator_test.gleam
+++ b/test/gleam/iterator_test.gleam
@@ -293,7 +293,7 @@ pub fn drop_while_test() {
pub fn scan_test() {
iterator.from_list([1, 2, 3, 4, 5])
- |> iterator.scan(from: 0, with: fn(el, acc) { acc + el })
+ |> iterator.scan(from: 0, with: fn(acc, el) { acc + el })
|> iterator.to_list
|> should.equal([1, 3, 6, 10, 15])
}
diff --git a/test/gleam/list_test.gleam b/test/gleam/list_test.gleam
index 8fc641a..73d9df5 100644
--- a/test/gleam/list_test.gleam
+++ b/test/gleam/list_test.gleam
@@ -234,7 +234,7 @@ pub fn try_fold_test() {
[1, 2, 3]
|> list.try_fold(
0,
- fn(i, acc) {
+ fn(acc, i) {
case i < 4 {
True -> Ok(acc + i)
False -> Error(Nil)
@@ -246,7 +246,7 @@ pub fn try_fold_test() {
[1, 2, 3]
|> list.try_fold(
0,
- fn(i, acc) {
+ fn(acc, i) {
case i < 3 {
True -> Ok(acc + i)
False -> Error(Nil)