

def test_to_a(self, space):
    w_res = space.execute('return (5..10).to_a')
    assert (self.unwrap(space, w_res) == [x for x in range(5, 11)])
    w_res = space.execute('return [1, 2, 3, 4].to_a')
    assert (self.unwrap(space, w_res) == [1, 2, 3, 4])
    w_res = space.execute('\n        class A\n          include Enumerable\n\n          def each\n            i = 0\n            while i < 5\n              yield i\n              i += 1\n            end\n          end\n        end\n        return A.new.to_a')
    assert (w_res.unwrap(space, w_res) == [0, 1, 2, 3, 4])

dataset/ETHPy150Open topazproject/topaz/tests/modules/test_enumerable.py TestEnumberable.test_to_a/VarMisuse@88/210 `self`->`w_res`