mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
SF bug #422088: [OSF1 alpha] string.replace().
Platform blew up on "123".replace("123", ""). Michael Hudson pinned the blame on platform malloc(0) returning NULL. This is a candidate for all bugfix releases.
This commit is contained in:
parent
0f8b494df6
commit
1a7b3eee94
2 changed files with 41 additions and 28 deletions
|
@ -177,6 +177,12 @@ def run_method_tests(test):
|
|||
test('replace', 'one!two!three!', 'one@two@three@', '!', '@')
|
||||
test('replace', 'one!two!three!', 'one!two!three!', 'x', '@')
|
||||
test('replace', 'one!two!three!', 'one!two!three!', 'x', '@', 2)
|
||||
# Next three for SF bug 422088: [OSF1 alpha] string.replace(); died with
|
||||
# MemoryError due to empty result (platform malloc issue when requesting
|
||||
# 0 bytes).
|
||||
test('replace', '123', '', '123', '')
|
||||
test('replace', '123123', '', '123', '')
|
||||
test('replace', '123x123', 'x', '123', '')
|
||||
|
||||
test('startswith', 'hello', 1, 'he')
|
||||
test('startswith', 'hello', 1, 'hello')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue