diff --git a/exercises/practice/flatten-array/.meta/tests.toml b/exercises/practice/flatten-array/.meta/tests.toml index c837910f00..6300219d71 100644 --- a/exercises/practice/flatten-array/.meta/tests.toml +++ b/exercises/practice/flatten-array/.meta/tests.toml @@ -30,6 +30,12 @@ description = "6 level nesting" [0705a8e5-dc86-4cec-8909-150c5e54fa9c] description = "null values are omitted from the final result" +[c6cf26de-8ccd-4410-84bd-b9efd88fd2bc] +description = "consecutive null values at the front of the list are omitted from the final result" + +[382c5242-587e-4577-b8ce-a5fb51e385a1] +description = "consecutive null values in the middle of the list are omitted from the final result" + [ef1d4790-1b1e-4939-a179-51ace0829dbd] description = "6 level nest list with null values" diff --git a/exercises/practice/flatten-array/test/flatten_array_test.exs b/exercises/practice/flatten-array/test/flatten_array_test.exs index c1e225d630..d63f17f9ab 100644 --- a/exercises/practice/flatten-array/test/flatten_array_test.exs +++ b/exercises/practice/flatten-array/test/flatten_array_test.exs @@ -43,6 +43,18 @@ defmodule FlattenArrayTest do [1, 2] end + @tag :pending + test "consecutive nil values at the front of the list are omitted from the final result" do + assert FlattenArray.flatten([nil, nil, 3]) == + [3] + end + + @tag :pending + test "consecutive nil values in the middle of the list are omitted from the final result" do + assert FlattenArray.flatten([1, nil, nil, 4]) == + [1, 4] + end + @tag :pending test "6 level nesting with nil values" do assert FlattenArray.flatten([0, 2, [[2, 3], 8, [[100]], nil, [[nil]]], -2]) ==