From 55e7b16fefdcc477719dda3e606828e154c35bdf Mon Sep 17 00:00:00 2001 From: Kayla Washburn Date: Thu, 13 Jul 2023 07:34:25 -0600 Subject: rename `list.flatten` to `list.concat` (#477) --- test/gleam/iterator_test.gleam | 6 +++--- test/gleam/list_test.gleam | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'test') 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 -> [] // } } -- cgit v1.2.3