diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-02-23 12:14:22 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-02-23 12:14:22 (GMT) |
commit | 659eb8445735337650c97fff41118b7a6d8b913e (patch) | |
tree | 0fc0e25cdd72cfcb141c46109717a17b332d3583 /Lib/test/test_unicode.py | |
parent | 02bfdb3f791a007801f2d14ed11b21bd6498ff9c (diff) | |
download | cpython-659eb8445735337650c97fff41118b7a6d8b913e.zip cpython-659eb8445735337650c97fff41118b7a6d8b913e.tar.gz cpython-659eb8445735337650c97fff41118b7a6d8b913e.tar.bz2 |
Merged revisions 88481 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r88481 | victor.stinner | 2011-02-21 22:13:44 +0100 (lun., 21 févr. 2011) | 4 lines
Fix PyUnicode_FromFormatV("%c") for non-BMP char
Issue #10830: Fix PyUnicode_FromFormatV("%c") for non-BMP characters on
narrow build.
........
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r-- | Lib/test/test_unicode.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index e2d67cd..9ad9eed 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -1427,7 +1427,7 @@ class UnicodeTest(string_tests.CommonTest, # Test PyUnicode_FromFormat() def test_from_format(self): support.import_module('ctypes') - from ctypes import pythonapi, py_object + from ctypes import pythonapi, py_object, c_int if sys.maxunicode == 65535: name = "PyUnicodeUCS2_FromFormat" else: @@ -1452,6 +1452,9 @@ class UnicodeTest(string_tests.CommonTest, 'string, got a non-ASCII byte: 0xe9$', PyUnicode_FromFormat, b'unicode\xe9=%s', 'ascii') + self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0xabcd)), '\uabcd') + self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0x10ffff)), '\U0010ffff') + # other tests text = PyUnicode_FromFormat(b'%%A:%A', 'abc\xe9\uabcd\U0010ffff') self.assertEqual(text, r"%A:'abc\xe9\uabcd\U0010ffff'") |