Пример #1
0
def test_multiple_arrays():
    res = flatten_array(array=[1, [2, 5], 3])
    assert res == [1, 2, 5, 3]
Пример #2
0
def test_empty_arrays():
    res = flatten_array(array=[[], []])
    assert res == []
Пример #3
0
def test_another_array_inside_array():
    res = flatten_array(array=[1, [1, 2], 3])
    assert res == [1, 1, 2, 3]
Пример #4
0
def test_one_array():
    res = flatten_array(array=[1, 2, 3])
    assert res == [1, 2, 3]
Пример #5
0
def test_empty_array():
    res = flatten_array(array=[])
    assert res == []
Пример #6
0
def test_example():
    res = flatten_array(array=[[1, 2, [3]], 4])
    assert res == [1, 2, 3, 4]
Пример #7
0
def test_array_with_array():
    res = flatten_array(array=[[1, 2, 5, 3]])
    assert res == [1, 2, 5, 3]
Пример #8
0
def test_all_arrays():
    res = flatten_array(array=[[1], [2], [5], [3]])
    assert res == [1, 2, 5, 3]