Ejemplo n.º 1
0
def test_multiple_arrays():
    res = flatten_array(array=[1, [2, 5], 3])
    assert res == [1, 2, 5, 3]
Ejemplo n.º 2
0
def test_empty_arrays():
    res = flatten_array(array=[[], []])
    assert res == []
Ejemplo n.º 3
0
def test_another_array_inside_array():
    res = flatten_array(array=[1, [1, 2], 3])
    assert res == [1, 1, 2, 3]
Ejemplo n.º 4
0
def test_one_array():
    res = flatten_array(array=[1, 2, 3])
    assert res == [1, 2, 3]
Ejemplo n.º 5
0
def test_empty_array():
    res = flatten_array(array=[])
    assert res == []
Ejemplo n.º 6
0
def test_example():
    res = flatten_array(array=[[1, 2, [3]], 4])
    assert res == [1, 2, 3, 4]
Ejemplo n.º 7
0
def test_array_with_array():
    res = flatten_array(array=[[1, 2, 5, 3]])
    assert res == [1, 2, 5, 3]
Ejemplo n.º 8
0
def test_all_arrays():
    res = flatten_array(array=[[1], [2], [5], [3]])
    assert res == [1, 2, 5, 3]