From: Stefan Behnel Date: Sun, 1 Mar 2009 19:50:15 +0000 (+0100) Subject: test case for ticket 227 X-Git-Tag: 0.11.rc~12^2~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f714ea48c7d43073ed9a67d927e3bf3846762a58;p=cython.git test case for ticket 227 --- diff --git a/tests/bugs/cdef_bool_T227.pyx b/tests/bugs/cdef_bool_T227.pyx new file mode 100644 index 00000000..cf07f53c --- /dev/null +++ b/tests/bugs/cdef_bool_T227.pyx @@ -0,0 +1,26 @@ +__doc__ = u""" +>>> foo(True) +True +>>> foo(False) +False +>>> foo('abc') # doctest: +ELLIPSIS +Traceback (most recent call last): +TypeError: ... + +>>> call_cfoo(True) +True +>>> call_cfoo(False) +False +>>> call_cfoo('abc') # doctest: +ELLIPSIS +Traceback (most recent call last): +TypeError: ... +""" + +def foo(bool a): + return a == True + +def call_cfoo(a): + return cfoo(a) + +cdef cfoo(bool a): + return a == True