diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-09-01 19:52:00 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-09-01 19:52:00 (GMT) |
commit | 3571fbfed7c49895a03b8c0de1fa47a9de112da9 (patch) | |
tree | 296f4aa5af122683ce6e20d0da17d7cc8fe48306 /Lib/test/string_tests.py | |
parent | aa5f873980994d1a216bcbe3d276d6a0b7d4b1cc (diff) | |
download | cpython-3571fbfed7c49895a03b8c0de1fa47a9de112da9.zip cpython-3571fbfed7c49895a03b8c0de1fa47a9de112da9.tar.gz cpython-3571fbfed7c49895a03b8c0de1fa47a9de112da9.tar.bz2 |
Issue #3751: str.rpartition would perform a left-partition when called with
a unicode argument.
will backport.
Diffstat (limited to 'Lib/test/string_tests.py')
-rw-r--r-- | Lib/test/string_tests.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index 3590b8e..63279ec 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -1117,6 +1117,9 @@ class MixinStrUnicodeUserStringTest: self.checkraises(ValueError, S, 'partition', '') self.checkraises(TypeError, S, 'partition', None) + # mixed use of str and unicode + self.assertEqual('a/b/c'.partition(u'/'), ('a', '/', 'b/c')) + def test_rpartition(self): self.checkequal(('this is the rparti', 'ti', 'on method'), @@ -1132,6 +1135,8 @@ class MixinStrUnicodeUserStringTest: self.checkraises(ValueError, S, 'rpartition', '') self.checkraises(TypeError, S, 'rpartition', None) + # mixed use of str and unicode + self.assertEqual('a/b/c'.rpartition(u'/'), ('a/b', '/', 'c')) class MixinStrStringUserStringTest: # Additional tests for 8bit strings, i.e. str, UserString and |