Ejemplo n.º 1
0
def test_cumulative_product_empty():
    assert cumulative_product([]) == []
Ejemplo n.º 2
0
def test_cumulative_product_starts_with_zero(values):
    array = [0] + list(values)
    assert cumulative_product(array) == [0] * len(array)
Ejemplo n.º 3
0
def test_cumulative_product_simple():
    assert cumulative_product([1, 2, 3]) == [1, 2, 6]
    assert cumulative_product([3, 2, 1]) == [3, 6, 6]
    assert cumulative_product([1, 2, 3, 4]) == [1, 2, 6, 24]
    assert cumulative_product([1, 2, 3, 3]) == [1, 2, 6, 18]