diff options
author | Guido van Rossum <guido@python.org> | 2002-08-23 18:21:28 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-08-23 18:21:28 +0000 |
commit | 8b1a6d694fa2f38cde77892c5ee0bb177be49db6 (patch) | |
tree | e3f7c901c642cd2500cb87648b6976c8d539a1fb /Lib/test/string_tests.py | |
parent | 280488b9a3b5cc213d01aae794751b89144f8609 (diff) | |
download | cpython-git-8b1a6d694fa2f38cde77892c5ee0bb177be49db6.tar.gz |
Code by Inyeol Lee, submitted to SF bug 595350, to implement
the string/unicode method .replace() with a zero-lengt first argument.
Inyeol contributed tests for this too.
Diffstat (limited to 'Lib/test/string_tests.py')
-rw-r--r-- | Lib/test/string_tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index a071f20089..f2d685329e 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -202,6 +202,10 @@ 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) + test('replace', 'abc', '-a-b-c-', '', '-') + test('replace', 'abc', '-a-b-c', '', '-', 3) + test('replace', 'abc', 'abc', '', '-', 0) + test('replace', '', '', '', '') # Next three for SF bug 422088: [OSF1 alpha] string.replace(); died with # MemoryError due to empty result (platform malloc issue when requesting # 0 bytes). |