Commit 7b50ad79 authored by Stefan Behnel's avatar Stefan Behnel

added doctest to compile test case

--HG--
rename : tests/compile/coercearraytoptr.pyx => tests/run/coercearraytoptr.pyx
parent d7115dec
cdef extern void spam(char *s)
cdef struct Grail:
char silly[42]
cdef void eggs():
cdef char silly[42]
cdef Grail grail
spam(silly)
spam(grail.silly)
eggs()
cdef char* cstring = "abcdefg"
cdef void spam(char *target):
cdef char* s = cstring
while s[0]:
target[0] = s[0]
s += 1
target += 1
target[0] = c'\0'
cdef struct Grail:
char silly[42]
def eggs():
"""
>>> print(str(eggs()).replace("b'", "'"))
('abcdefg', 'abcdefg')
"""
cdef char silly[42]
cdef Grail grail
spam(silly)
spam(grail.silly)
return silly, grail.silly
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