projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15c349e
)
add regression test for non-optimised unicode.encode() calls
author
Stefan Behnel
<stefan_ml@behnel.de>
Sun, 3 Nov 2013 17:30:31 +0000
(18:30 +0100)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Sun, 3 Nov 2013 17:30:31 +0000
(18:30 +0100)
tests/run/unicodeencode.pyx
patch
|
blob
|
history
diff --git
a/tests/run/unicodeencode.pyx
b/tests/run/unicodeencode.pyx
index
91dbbb3
..
c98b9a7
100644
(file)
--- a/
tests/run/unicodeencode.pyx
+++ b/
tests/run/unicodeencode.pyx
@@
-20,6
+20,15
@@
def default():
"""
return u'abcdefg'.encode()
+def encode_non_constant(encoding):
+ """
+ >>> isinstance(encode_non_constant('utf8'), _bytes)
+ True
+ >>> encode_non_constant('utf8') == u.encode('UTF-8')
+ True
+ """
+ return text.encode(encoding)
+
@cython.test_assert_path_exists('//PythonCapiFunctionNode[@cname = "PyUnicode_AsUTF8String"]')
def utf8():
"""