diff options
| author | Raymond Hettinger <python@rcn.com> | 2007-04-12 04:10:00 +0000 |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2007-04-12 04:10:00 +0000 |
| commit | 4db5fe970c695c373c59ac7152eb07b07249b0b5 (patch) | |
| tree | b245934756e45a1dbc07fae5a07481373e560106 /Lib/test/string_tests.py | |
| parent | 51761806105a4cc2f58325f46a6d33c8144ad617 (diff) | |
| download | cpython-git-4db5fe970c695c373c59ac7152eb07b07249b0b5.tar.gz | |
SF 1193128: Let str.translate(None) be an identity transformation
Diffstat (limited to 'Lib/test/string_tests.py')
| -rw-r--r-- | Lib/test/string_tests.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index 1aa68dedd0..16161f3ff4 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -1096,6 +1096,9 @@ class MixinStrStringUserStringTest: self.checkequal('Abc', 'abc', 'translate', table) self.checkequal('xyz', 'xyz', 'translate', table) self.checkequal('yz', 'xyz', 'translate', table, 'x') + self.checkequal('yx', 'zyzzx', 'translate', None, 'z') + self.checkequal('zyzzx', 'zyzzx', 'translate', None, '') + self.checkequal('zyzzx', 'zyzzx', 'translate', None) self.checkraises(ValueError, 'xyz', 'translate', 'too short', 'strip') self.checkraises(ValueError, 'xyz', 'translate', 'too short') |
