Skip to content

[Flatten Array]: Updated Tests & Regenerated Test Cases #3881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions exercises/practice/flatten-array/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,32 @@ 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"
include = false

[bc72da10-5f55-4ada-baf3-50e4da02ec8e]
description = "consecutive null values at the front of the array are omitted from the final result"
reimplements = "c6cf26de-8ccd-4410-84bd-b9efd88fd2bc"

[382c5242-587e-4577-b8ce-a5fb51e385a1]
description = "consecutive null values in the middle of the list are omitted from the final result"
include = false

[6991836d-0d9b-4703-80a0-3f1f23eb5981]
description = "consecutive null values in the middle of the array are omitted from the final result"
reimplements = "382c5242-587e-4577-b8ce-a5fb51e385a1"

[ef1d4790-1b1e-4939-a179-51ace0829dbd]
description = "6 level nest list with null values"
include = false

[dc90a09c-5376-449c-a7b3-c2d20d540069]
description = "6 level nested array with null values"
reimplements = "ef1d4790-1b1e-4939-a179-51ace0829dbd"

[85721643-705a-4150-93ab-7ae398e2942d]
description = "all values in nested list are null"
include = false

[51f5d9af-8f7f-4fb5-a156-69e8282cb275]
description = "all values in nested array are null"
reimplements = "85721643-705a-4150-93ab-7ae398e2942d"
10 changes: 5 additions & 5 deletions exercises/practice/flatten-array/flatten_array_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/flatten-array/canonical-data.json
# File last updated on 2023-07-19
# File last updated on 2025-03-22

import unittest

Expand Down Expand Up @@ -45,26 +45,26 @@ def test_null_values_are_omitted_from_the_final_result(self):
expected = [1, 2]
self.assertEqual(flatten(inputs), expected)

def test_consecutive_null_values_at_the_front_of_the_list_are_omitted_from_the_final_result(
def test_consecutive_null_values_at_the_front_of_the_array_are_omitted_from_the_final_result(
self,
):
inputs = [None, None, 3]
expected = [3]
self.assertEqual(flatten(inputs), expected)

def test_consecutive_null_values_in_the_middle_of_the_list_are_omitted_from_the_final_result(
def test_consecutive_null_values_in_the_middle_of_the_array_are_omitted_from_the_final_result(
self,
):
inputs = [1, None, None, 4]
expected = [1, 4]
self.assertEqual(flatten(inputs), expected)

def test_6_level_nest_list_with_null_values(self):
def test_6_level_nested_array_with_null_values(self):
inputs = [0, 2, [[2, 3], 8, [[100]], None, [[None]]], -2]
expected = [0, 2, 2, 3, 8, 100, -2]
self.assertEqual(flatten(inputs), expected)

def test_all_values_in_nested_list_are_null(self):
def test_all_values_in_nested_array_are_null(self):
inputs = [None, [[[None]]], None, None, [[None, None], None], None]
expected = []
self.assertEqual(flatten(inputs), expected)
Loading