summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2020-06-22 22:51:06 +0200
committerStefan Behnel <stefan_ml@behnel.de>2020-06-22 22:51:06 +0200
commitcfc3a80aab4ea5c401ee53ff1062dbec9943ea5a (patch)
tree51c13bbbbf5507b32212067a5dc5b23164355d93
parentf713beed8c4ca842279408f712204220ae6ea927 (diff)
downloadcython-cfc3a80aab4ea5c401ee53ff1062dbec9943ea5a.tar.gz
Extend the surrogate pairs test in a way that also works in Py2.
-rw-r--r--Cython/Compiler/Tests/TestStringEncoding.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Cython/Compiler/Tests/TestStringEncoding.py b/Cython/Compiler/Tests/TestStringEncoding.py
index 13e81ba23..76de06905 100644
--- a/Cython/Compiler/Tests/TestStringEncoding.py
+++ b/Cython/Compiler/Tests/TestStringEncoding.py
@@ -19,6 +19,7 @@ class StringEncodingTest(unittest.TestCase):
# but it seems to be a parser bug in Py2, which doesn't hurt us in Cython.
if sys.version_info[0] != 2:
self.assertTrue(StringEncoding.string_contains_lone_surrogates(u"\uD800\uDFFF"))
+ self.assertTrue(StringEncoding.string_contains_lone_surrogates(u"\uDFFF\uD800"[::-1]))
self.assertTrue(StringEncoding.string_contains_lone_surrogates(u"\uD800"))
self.assertTrue(StringEncoding.string_contains_lone_surrogates(u"\uDFFF"))