

def test_inject(self, space):
    w_res = space.execute('\n        return (5..10).inject(1) do |prod, n|\n          prod * n\n        end\n        ')
    assert (space.int_w(w_res) == 151200)
    w_res = space.execute('\n        return (1..10).inject(0) do |sum, n|\n          sum + n\n        end\n        ')
    assert (space.int_w(w_res) == 55)

dataset/ETHPy150Open topazproject/topaz/tests/modules/test_enumerable.py TestEnumberable.test_inject/original