Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
9326949f
Commit
9326949f
authored
Oct 26, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check for bytes.decode() optimisation in test case
parent
df949a4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
tests/run/carray_slicing.pyx
tests/run/carray_slicing.pyx
+8
-0
No files found.
tests/run/carray_slicing.pyx
View file @
9326949f
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'", "'")
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment