Commit d6719b66 authored by Robert Bradshaw's avatar Robert Bradshaw

Test for typedef in stl container.

parent 967c8e11
...@@ -116,6 +116,24 @@ def test_double_vector(o): ...@@ -116,6 +116,24 @@ def test_double_vector(o):
cdef vector[double] v = o cdef vector[double] v = o
return v return v
ctypedef int my_int
def test_typedef_vector(o):
"""
>>> test_typedef_vector([1, 2, 3])
[1, 2, 3]
>>> test_typedef_vector([1, 2, 3**100])
Traceback (most recent call last):
...
OverflowError: Python int too large to convert to C long
>>> test_typedef_vector([1, 2, None])
Traceback (most recent call last):
...
TypeError: an integer is required
"""
cdef vector[my_int] v = o
return v
def test_pair(o): def test_pair(o):
""" """
>>> test_pair((1, 2)) >>> test_pair((1, 2))
......
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