From f714ea48c7d43073ed9a67d927e3bf3846762a58 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 1 Mar 2009 20:50:15 +0100 Subject: [PATCH] test case for ticket 227 --- tests/bugs/cdef_bool_T227.pyx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/bugs/cdef_bool_T227.pyx 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 -- 2.26.2