cython-devel
changeset 1801:3e08dec3cdd0
test case for ticket 227
| author | Stefan Behnel <scoder@users.berlios.de> |
|---|---|
| date | Sun Mar 01 20:50:15 2009 +0100 (2 years ago) |
| parents | e8b5a8e5da3d |
| children | fa0111c401cc |
| files | tests/bugs/cdef_bool_T227.pyx |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/tests/bugs/cdef_bool_T227.pyx Sun Mar 01 20:50:15 2009 +0100
1.3 @@ -0,0 +1,26 @@
1.4 +__doc__ = u"""
1.5 +>>> foo(True)
1.6 +True
1.7 +>>> foo(False)
1.8 +False
1.9 +>>> foo('abc') # doctest: +ELLIPSIS
1.10 +Traceback (most recent call last):
1.11 +TypeError: ...
1.12 +
1.13 +>>> call_cfoo(True)
1.14 +True
1.15 +>>> call_cfoo(False)
1.16 +False
1.17 +>>> call_cfoo('abc') # doctest: +ELLIPSIS
1.18 +Traceback (most recent call last):
1.19 +TypeError: ...
1.20 +"""
1.21 +
1.22 +def foo(bool a):
1.23 + return a == True
1.24 +
1.25 +def call_cfoo(a):
1.26 + return cfoo(a)
1.27 +
1.28 +cdef cfoo(bool a):
1.29 + return a == True
