From 5832ccd7189549dbb4ae4fb6b6cd249883446454 Mon Sep 17 00:00:00 2001 From: Giacomo Cavalieri Date: Sat, 26 Aug 2023 13:42:38 +0200 Subject: Remove the deprecation notice from `list.flatten` --- test/gleam/list_test.gleam | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/gleam/list_test.gleam b/test/gleam/list_test.gleam index c4305f5..321f5a4 100644 --- a/test/gleam/list_test.gleam +++ b/test/gleam/list_test.gleam @@ -306,6 +306,20 @@ pub fn concat_test() { // } } +pub fn flatten_test() { + list.flatten([]) + |> should.equal([]) + + list.flatten([[]]) + |> should.equal([]) + + list.flatten([[], [], []]) + |> should.equal([]) + + list.flatten([[1, 2], [], [3, 4]]) + |> should.equal([1, 2, 3, 4]) +} + pub fn flat_map_test() { list.flat_map([1, 10, 20], fn(x) { [x, x + 1] }) |> should.equal([1, 2, 10, 11, 20, 21]) -- cgit v1.2.3