test case for ticket 227
authorStefan Behnel <scoder@users.berlios.de>
Sun, 1 Mar 2009 19:50:15 +0000 (20:50 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 1 Mar 2009 19:50:15 +0000 (20:50 +0100)
tests/bugs/cdef_bool_T227.pyx [new file with mode: 0644]

diff --git a/tests/bugs/cdef_bool_T227.pyx b/tests/bugs/cdef_bool_T227.pyx
new file mode 100644 (file)
index 0000000..cf07f53
--- /dev/null
@@ -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