Commit 85e7bd5a authored by Stefan Behnel's avatar Stefan Behnel

extended test case for ticket 252

--HG--
rename : tests/compile/bad_c_struct_T252.pyx => tests/run/bad_c_struct_T252.pyx
parent cfc3b84d
cdef f(void=None):
pass
cdef struct foo:
int void
cdef class Foo:
cdef int void
cdef cf(default=None):
return default
cpdef cpf(default=None):
"""
>>> cpf()
None
>>> cpf(1)
1
>>> cpf(default=2)
2
"""
default = cf(default)
return default
def pf(default=None):
"""
>>> pf()
None
>>> pf(1)
1
>>> pf(default=2)
2
"""
return default
cdef struct foo:
int void
int default
def test_struct():
"""
>>> test_struct()
(1, 2)
"""
cdef foo foo_struct
foo_struct.void = 1
foo_struct.default = 2
return foo_struct.void, foo_struct.default
cdef class Foo:
cdef int void
cdef int default
def test_class():
"""
>>> test_class()
(1, 2)
"""
cdef Foo foo_instance = Foo()
foo_instance.void = 1
foo_instance.default = 2
return foo_instance.void, foo_instance.default
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