Commit 71265979 authored by Stefan Behnel's avatar Stefan Behnel

extended test case for list.pop()

parent 844cfa34
......@@ -9,6 +9,12 @@ __doc__ = u"""
[2, 3, 4]
>>> k(1, 2, 3, 4, 5)
[17, 42, 88]
>>> test_list_pop()
(2, [1])
>>> test_list_pop0()
(1, [2])
>>> test_list_pop_all()
True
"""
def f(obj1, obj2, obj3, obj4, obj5):
......@@ -30,3 +36,26 @@ def j(obj1, obj2, obj3, obj4, obj5):
def k(obj1, obj2, obj3, obj4, obj5):
obj1 = [17, 42, 88]
return obj1
def test_list_pop():
cdef list s1
l1 = [1,2]
two = l1.pop()
return two, l1
def test_list_pop0():
cdef list s1
l1 = [1,2]
one = l1.pop(0)
return one, l1
def test_list_pop_all():
cdef list s1
l1 = [1,2]
try:
l1.pop()
l1.pop(-1)
l1.pop(0)
except IndexError:
return True
return False
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment