mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Add tests for issue #18183.
This commit is contained in:
parent
f467521927
commit
31b1c8bbde
1 changed files with 15 additions and 3 deletions
|
@ -566,9 +566,6 @@ class UnicodeTest(string_tests.CommonTest,
|
||||||
self.assertEqual('\U0008fffe'.lower(), '\U0008fffe')
|
self.assertEqual('\U0008fffe'.lower(), '\U0008fffe')
|
||||||
self.assertEqual('\u2177'.lower(), '\u2177')
|
self.assertEqual('\u2177'.lower(), '\u2177')
|
||||||
|
|
||||||
# See issue #18183 for this one.
|
|
||||||
'\U00010000\U00100000'.lower()
|
|
||||||
|
|
||||||
def test_casefold(self):
|
def test_casefold(self):
|
||||||
self.assertEqual('hello'.casefold(), 'hello')
|
self.assertEqual('hello'.casefold(), 'hello')
|
||||||
self.assertEqual('hELlo'.casefold(), 'hello')
|
self.assertEqual('hELlo'.casefold(), 'hello')
|
||||||
|
@ -686,6 +683,17 @@ class UnicodeTest(string_tests.CommonTest,
|
||||||
|
|
||||||
self.assertRaises(TypeError, "abc".__contains__)
|
self.assertRaises(TypeError, "abc".__contains__)
|
||||||
|
|
||||||
|
def test_issue18183(self):
|
||||||
|
'\U00010000\U00100000'.lower()
|
||||||
|
'\U00010000\U00100000'.casefold()
|
||||||
|
'\U00010000\U00100000'.upper()
|
||||||
|
'\U00010000\U00100000'.capitalize()
|
||||||
|
'\U00010000\U00100000'.title()
|
||||||
|
'\U00010000\U00100000'.swapcase()
|
||||||
|
'\U00100000'.center(3, '\U00010000')
|
||||||
|
'\U00100000'.ljust(3, '\U00010000')
|
||||||
|
'\U00100000'.rjust(3, '\U00010000')
|
||||||
|
|
||||||
def test_format(self):
|
def test_format(self):
|
||||||
self.assertEqual(''.format(), '')
|
self.assertEqual(''.format(), '')
|
||||||
self.assertEqual('a'.format(), 'a')
|
self.assertEqual('a'.format(), 'a')
|
||||||
|
@ -2016,6 +2024,10 @@ class UnicodeTest(string_tests.CommonTest,
|
||||||
# test "%c"
|
# test "%c"
|
||||||
self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0xabcd)), '\uabcd')
|
self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0xabcd)), '\uabcd')
|
||||||
self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0x10ffff)), '\U0010ffff')
|
self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0x10ffff)), '\U0010ffff')
|
||||||
|
# Issue #18183
|
||||||
|
self.assertEqual(
|
||||||
|
PyUnicode_FromFormat(b'%c%c', c_int(0x10000), c_int(0x100000)),
|
||||||
|
'\U00010000\U00100000')
|
||||||
|
|
||||||
# test "%"
|
# test "%"
|
||||||
self.assertEqual(PyUnicode_FromFormat(b'%'), '%')
|
self.assertEqual(PyUnicode_FromFormat(b'%'), '%')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue