From: Stefan Behnel Date: Mon, 26 Oct 2009 08:49:46 +0000 (+0100) Subject: check for bytes.decode() optimisation in test case X-Git-Tag: 0.12.alpha0~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9326949f15f3faa9caada8cc99452babac59a42b;p=cython.git check for bytes.decode() optimisation in test case --- 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'", "'")