def notest_list_empty_after_delete(self): l = W_ListObject(self.space, [self.space.wrap(3)]) assert isinstance(l.strategy, IntegerListStrategy) l.deleteitem(0) assert isinstance(l.strategy, EmptyListStrategy) l = W_ListObject(self.space, [self.space.wrap(1), self.space.wrap(2)]) assert isinstance(l.strategy, IntegerListStrategy) l.deleteslice(0, 1, 2) assert isinstance(l.strategy, EmptyListStrategy) l = W_ListObject(self.space, [self.space.wrap(1)]) assert isinstance(l.strategy, IntegerListStrategy) l.pop(-1) assert isinstance(l.strategy, EmptyListStrategy)
def test_list_empty_after_delete(self): py.test.skip("return to emptyliststrategy is not supported anymore") l = W_ListObject(self.space, [self.space.wrap(3)]) assert isinstance(l.strategy, IntegerListStrategy) l.deleteitem(0) assert isinstance(l.strategy, EmptyListStrategy) l = W_ListObject(self.space, [self.space.wrap(1), self.space.wrap(2)]) assert isinstance(l.strategy, IntegerListStrategy) l.deleteslice(0, 1, 2) assert isinstance(l.strategy, EmptyListStrategy) l = W_ListObject(self.space, [self.space.wrap(1)]) assert isinstance(l.strategy, IntegerListStrategy) l.pop(-1) assert isinstance(l.strategy, EmptyListStrategy)
def test_pop_without_argument_is_fast(self): space = self.space w_l = W_ListObject( space, [space.wrap(1), space.wrap(2), space.wrap(3)]) w_l.pop = None w_res = w_l.descr_pop(space) assert space.unwrap(w_res) == 3
def test_pop_without_argument_is_fast(self): space = self.space w_l = W_ListObject( space, [space.wrap(1), space.wrap(2), space.wrap(3)]) w_l.pop = None w_res = listobject.list_pop__List_ANY(space, w_l, space.w_None) # does not crash assert space.unwrap(w_res) == 3
def test_pop_without_argument_is_fast(self): space = self.space w_l = W_ListObject(space, [space.wrap(1), space.wrap(2), space.wrap(3)]) w_l.pop = None w_res = listobject.list_pop__List_ANY(space, w_l, space.w_None) # does not crash assert space.unwrap(w_res) == 3
def test_pop_without_argument_is_fast(self): space = self.space w_l = W_ListObject(space, [space.wrap(1), space.wrap(2), space.wrap(3)]) w_l.pop = None w_res = w_l.descr_pop(space) assert space.unwrap(w_res) == 3