mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
SF 1193128: Let str.translate(None) be an identity transformation
This commit is contained in:
parent
5176180610
commit
4db5fe970c
6 changed files with 33 additions and 10 deletions
|
|
@ -1096,6 +1096,9 @@ def test_translate(self):
|
|||
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')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue