mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Patch #650653: Raise always value error if the table is not 256 bytes long.
This commit is contained in:
parent
63b4dd33c9
commit
00b6127097
2 changed files with 8 additions and 6 deletions
|
@ -192,6 +192,8 @@ def run_method_tests(test):
|
|||
table = string.maketrans('a', 'A')
|
||||
test('translate', 'abc', 'Abc', table)
|
||||
test('translate', 'xyz', 'xyz', table)
|
||||
test('translate', 'xyz', ValueError, 'too short', 'strip')
|
||||
test('translate', 'xyz', ValueError, 'too short')
|
||||
|
||||
test('replace', 'one!two!three!', 'one@two!three!', '!', '@', 1)
|
||||
test('replace', 'one!two!three!', 'onetwothree', '!', '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue