gh-94808: Cover str.rsplit for UCS1, UCS2 or UCS4 (#98228)

This commit is contained in:
Nikita Sobolev 2022-10-15 21:40:22 +03:00 committed by GitHub
parent f4370318d6
commit b7dd2cad18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View file

@ -445,10 +445,10 @@ class UnicodeTest(string_tests.CommonTest,
def test_rsplit(self):
string_tests.CommonTest.test_rsplit(self)
# test mixed kinds
for left, right in ('ba', '\u0101\u0100', '\U00010301\U00010300'):
for left, right in ('ba', 'юё', '\u0101\u0100', '\U00010301\U00010300'):
left *= 9
right *= 9
for delim in ('c', '\u0102', '\U00010302'):
for delim in ('c', 'ы', '\u0102', '\U00010302'):
self.checkequal([left + right],
left + right, 'rsplit', delim)
self.checkequal([left, right],
@ -458,6 +458,10 @@ class UnicodeTest(string_tests.CommonTest,
self.checkequal([left, right],
left + delim * 2 + right, 'rsplit', delim *2)
# Check `None` as well:
self.checkequal([left + right],
left + right, 'rsplit', None)
def test_partition(self):
string_tests.MixinStrUnicodeUserStringTest.test_partition(self)
# test mixed kinds