

def test_reject(self, space):
    w_res = space.execute('return [1, 2, 3].reject { |i| i == 3 }')
    assert (self.unwrap(space, w_res) == [1, 2])
    w_res = space.execute('return [].reject { |i| i == 3 }')
    assert (self.unwrap(space, w_res) == [])
    w_res = space.execute('return (1..10).reject { |i| i > 11 }')
    assert (self.unwrap(space, w_res) == range(1, 11))
    w_res = space.execute('return (1..10).reject { |i| i < 11 }')
    assert (self.unwrap(space, w_res) == [])

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