diff options
author | Kayla Washburn <mckayla@hey.com> | 2023-07-13 07:34:25 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-13 14:34:25 +0100 |
commit | 55e7b16fefdcc477719dda3e606828e154c35bdf (patch) | |
tree | 54ac4edb4a34a2126f964d55ce1e2bea9923d180 /test | |
parent | 682d9e03ba2847c63b9f3882bb3d743b67552def (diff) | |
download | gleam_stdlib-55e7b16fefdcc477719dda3e606828e154c35bdf.tar.gz gleam_stdlib-55e7b16fefdcc477719dda3e606828e154c35bdf.zip |
rename `list.flatten` to `list.concat` (#477)
Diffstat (limited to 'test')
-rw-r--r-- | test/gleam/iterator_test.gleam | 6 | ||||
-rw-r--r-- | test/gleam/list_test.gleam | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/test/gleam/iterator_test.gleam b/test/gleam/iterator_test.gleam index 5348183..bb9a825 100644 --- a/test/gleam/iterator_test.gleam +++ b/test/gleam/iterator_test.gleam @@ -167,7 +167,7 @@ pub fn flat_map_test() { subject |> list.map(f) |> list.map(iterator.to_list) - |> list.flatten, + |> list.concat, ) } @@ -185,7 +185,7 @@ pub fn append_test() { |> iterator.from_list |> iterator.append(iterator.from_list(right)) |> iterator.to_list - |> should.equal(list.flatten([left, right])) + |> should.equal(list.concat([left, right])) } test([], []) @@ -201,7 +201,7 @@ pub fn flatten_test() { |> iterator.from_list |> iterator.flatten |> iterator.to_list - |> should.equal(list.flatten(lists)) + |> should.equal(list.concat(lists)) } test([[], []]) diff --git a/test/gleam/list_test.gleam b/test/gleam/list_test.gleam index bf8bb2a..2883535 100644 --- a/test/gleam/list_test.gleam +++ b/test/gleam/list_test.gleam @@ -287,23 +287,23 @@ pub fn append_test() { |> list.append([1]) } -pub fn flatten_test() { - list.flatten([]) +pub fn concat_test() { + list.concat([]) |> should.equal([]) - list.flatten([[]]) + list.concat([[]]) |> should.equal([]) - list.flatten([[], [], []]) + list.concat([[], [], []]) |> should.equal([]) - list.flatten([[1, 2], [], [3, 4]]) + list.concat([[1, 2], [], [3, 4]]) |> should.equal([1, 2, 3, 4]) // // TCO test // case recursion_test_cycles > 2 { // True -> // list.repeat([[1]], recursion_test_cycles / 50) - // |> list.flatten() + // |> list.concat() // False -> [] // } } |