mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #23803: Fixed str.partition() and str.rpartition() when a separator
is wider then partitioned string.
This commit is contained in:
parent
9db55004a1
commit
48070c1248
3 changed files with 10 additions and 5 deletions
|
@ -375,6 +375,7 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
def test_partition(self):
|
||||
string_tests.MixinStrUnicodeUserStringTest.test_partition(self)
|
||||
# test mixed kinds
|
||||
self.checkequal(('ABCDEFGH', '', ''), 'ABCDEFGH', 'partition', '\u4200')
|
||||
for left, right in ('ba', '\u0101\u0100', '\U00010301\U00010300'):
|
||||
left *= 9
|
||||
right *= 9
|
||||
|
@ -391,6 +392,7 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
def test_rpartition(self):
|
||||
string_tests.MixinStrUnicodeUserStringTest.test_rpartition(self)
|
||||
# test mixed kinds
|
||||
self.checkequal(('', '', 'ABCDEFGH'), 'ABCDEFGH', 'rpartition', '\u4200')
|
||||
for left, right in ('ba', '\u0101\u0100', '\U00010301\U00010300'):
|
||||
left *= 9
|
||||
right *= 9
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue