Commit 935b691c authored by Joe Jevnik's avatar Joe Jevnik

add tests for std::vector::insert(iterator, size_type, const T&)

parent a4da52aa
...@@ -195,3 +195,18 @@ def test_typedef_vector(L): ...@@ -195,3 +195,18 @@ def test_typedef_vector(L):
vb.insert(vb.begin(), vb2.begin(), vb2.end()) vb.insert(vb.begin(), vb2.begin(), vb2.end())
return vi, vi.at(0), vb, vb.at(0) return vi, vi.at(0), vb, vb.at(0)
def test_insert():
"""
>>> test_insert()
"""
cdef vector[int] v
cdef vector[int].size_type count = 5
cdef int value = 0
v.insert(v.end(), count, value)
assert v.size() == count
for element in v:
assert element == value, '%s != %s' % (element, count)
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