diff Lib/test/string_tests.py @ 25004:762dd09edb83 legacy-trunk

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.
author Guido van Rossum <guido@python.org>
date Fri, 23 Aug 2002 18:21:28 +0000
parents 274e42a691e0
children d66129b551db
line wrap: on
line diff
--- a/Lib/test/string_tests.py	Fri Aug 23 18:19:30 2002 +0000
+++ b/Lib/test/string_tests.py	Fri Aug 23 18:21:28 2002 +0000
@@ -202,6 +202,10 @@
     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).