Kaydet (Commit) 51f6648a authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Make test more inclusive

üst dffab192
...@@ -1407,12 +1407,10 @@ class UnicodeTest(string_tests.CommonTest, ...@@ -1407,12 +1407,10 @@ class UnicodeTest(string_tests.CommonTest,
'unicode_escape', 'unicode_internal'): 'unicode_escape', 'unicode_internal'):
self.assertEqual(str(u.encode(encoding),encoding), u) self.assertEqual(str(u.encode(encoding),encoding), u)
# UTF-8 must be roundtrip safe for all UCS-2 code points # UTF-8 must be roundtrip safe for all code points
# This excludes surrogates: in the full range, there would be # (except surrogates, which are forbidden).
# a surrogate pair (\udbff\udc00), which gets converted back u = ''.join(map(chr, list(range(0, 0xd800)) +
# to a non-BMP character (\U0010fc00) list(range(0xe000, 0x10ffff))))
u = ''.join(map(chr, list(range(0,0xd800)) +
list(range(0xe000,0x10000))))
for encoding in ('utf-8',): for encoding in ('utf-8',):
self.assertEqual(str(u.encode(encoding),encoding), u) self.assertEqual(str(u.encode(encoding),encoding), u)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment