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:
Tim Peters 2001-05-09 23:00:26 +00:00
parent 0f8b494df6
commit 1a7b3eee94
2 changed files with 41 additions and 28 deletions

View file

@ -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')