From 9326949f15f3faa9caada8cc99452babac59a42b Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 26 Oct 2009 09:49:46 +0100 Subject: [PATCH] check for bytes.decode() optimisation in test case --- tests/run/carray_slicing.pyx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/run/carray_slicing.pyx b/tests/run/carray_slicing.pyx index 29ba2330..35d9bf5d 100644 --- a/tests/run/carray_slicing.pyx +++ b/tests/run/carray_slicing.pyx @@ -1,4 +1,6 @@ +cimport cython + cdef char* cstring = "abcABCqtp" def slice_charptr_end(): @@ -8,6 +10,8 @@ def slice_charptr_end(): """ return cstring[:1], cstring[:3], cstring[:9] +@cython.test_assert_path_exists("//PythonCapiCallNode") +@cython.test_fail_if_path_exists("//AttributeNode") def slice_charptr_decode(): """ >>> print str(slice_charptr_decode()).replace("u'", "'") @@ -17,6 +21,8 @@ def slice_charptr_decode(): cstring[:3].decode('UTF-8'), cstring[:9].decode('UTF-8')) +@cython.test_assert_path_exists("//PythonCapiCallNode") +@cython.test_fail_if_path_exists("//AttributeNode") def slice_charptr_decode_unbound(): """ >>> print str(slice_charptr_decode_unbound()).replace("u'", "'") @@ -26,6 +32,8 @@ def slice_charptr_decode_unbound(): bytes.decode(cstring[:3], 'UTF-8', 'replace'), bytes.decode(cstring[:9], 'UTF-8')) +@cython.test_assert_path_exists("//PythonCapiCallNode") +@cython.test_fail_if_path_exists("//AttributeNode") def slice_charptr_decode_errormode(): """ >>> print str(slice_charptr_decode_errormode()).replace("u'", "'") -- 2.26.2