From 758080381b6148f70bca9c674c002e0d1312e4a5 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 11 Aug 2010 12:53:25 -0700 Subject: [PATCH] cpp_bool test (failing) --- tests/bugs.txt | 1 + tests/run/cpp_bool.pyx | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/run/cpp_bool.pyx diff --git a/tests/bugs.txt b/tests/bugs.txt index 97283827..cb56af8b 100644 --- a/tests/bugs.txt +++ b/tests/bugs.txt @@ -16,6 +16,7 @@ with_statement_module_level_T536 function_as_method_T494 closure_inside_cdef_T554 ipow_crash_T562 +cpp_bool # CPython regression tests that don't current work: pyregr.test_threadsignals diff --git a/tests/run/cpp_bool.pyx b/tests/run/cpp_bool.pyx new file mode 100644 index 00000000..14a7b81e --- /dev/null +++ b/tests/run/cpp_bool.pyx @@ -0,0 +1,18 @@ +from libcpp cimport bool + +def test_bool(bool a): + """ + >>> test_bool(True) + True + >>> test_bool(1) + True + >>> test_bool(0) + False + >>> test_bool(100) + True + >>> test_bool(None) + False + >>> test_bool([]) + False + """ + return a -- 2.26.2