aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGiacomo Cavalieri <giacomo.cavalieri@icloud.com>2023-08-26 13:42:38 +0200
committerLouis Pilfold <louis@lpil.uk>2023-09-04 12:50:50 +0100
commit5832ccd7189549dbb4ae4fb6b6cd249883446454 (patch)
tree839641165eee4fa0e6cca5bebc218651220fed49 /test
parent9b3f2296ec5b1937abe618cc28716a30c712c20d (diff)
downloadgleam_stdlib-5832ccd7189549dbb4ae4fb6b6cd249883446454.tar.gz
gleam_stdlib-5832ccd7189549dbb4ae4fb6b6cd249883446454.zip
Remove the deprecation notice from `list.flatten`
Diffstat (limited to 'test')
-rw-r--r--test/gleam/list_test.gleam14
1 files changed, 14 insertions, 0 deletions
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])