diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-11-11 12:35:44 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-11-11 12:35:44 (GMT) |
commit | 51f6648a31be8d73e527a06315326fb9f1223fd5 (patch) | |
tree | 5fb27f8da7adbb8ffa3579a4d5b3b9f0916b33cc /Lib/test/test_unicode.py | |
parent | dffab192182f01bd0b21ac7b0bde0227214fd091 (diff) | |
download | cpython-51f6648a31be8d73e527a06315326fb9f1223fd5.zip cpython-51f6648a31be8d73e527a06315326fb9f1223fd5.tar.gz cpython-51f6648a31be8d73e527a06315326fb9f1223fd5.tar.bz2 |
Make test more inclusive
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r-- | Lib/test/test_unicode.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 6335a12..811da0a 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -1407,12 +1407,10 @@ class UnicodeTest(string_tests.CommonTest, 'unicode_escape', 'unicode_internal'): self.assertEqual(str(u.encode(encoding),encoding), u) - # UTF-8 must be roundtrip safe for all UCS-2 code points - # This excludes surrogates: in the full range, there would be - # a surrogate pair (\udbff\udc00), which gets converted back - # to a non-BMP character (\U0010fc00) - u = ''.join(map(chr, list(range(0,0xd800)) + - list(range(0xe000,0x10000)))) + # UTF-8 must be roundtrip safe for all code points + # (except surrogates, which are forbidden). + u = ''.join(map(chr, list(range(0, 0xd800)) + + list(range(0xe000, 0x10ffff)))) for encoding in ('utf-8',): self.assertEqual(str(u.encode(encoding),encoding), u) |