summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_strop.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-05-10 01:23:39 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-05-10 01:23:39 (GMT)
commit1ee77d9b71dab3b42b3c00760216cc4955a3cfeb (patch)
tree835e226526d2abef1f1eeef68e4fe758fbc40a40 /Lib/test/test_strop.py
parentda45d55a6ecff00ca714cbcf66fb2133621ca836 (diff)
downloadcpython-1ee77d9b71dab3b42b3c00760216cc4955a3cfeb.zip
cpython-1ee77d9b71dab3b42b3c00760216cc4955a3cfeb.tar.gz
cpython-1ee77d9b71dab3b42b3c00760216cc4955a3cfeb.tar.bz2
Guido has Spoken. Restore strop.replace()'s treatment of a 0 count as
meaning infinity -- but at least warn about it in the code! I pissed away a couple hours on this today, and don't wish the same on the next in line. Bugfix candidate.
Diffstat (limited to 'Lib/test/test_strop.py')
-rw-r--r--Lib/test/test_strop.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_strop.py b/Lib/test/test_strop.py
index de7a795..9130088 100644
--- a/Lib/test/test_strop.py
+++ b/Lib/test/test_strop.py
@@ -77,7 +77,9 @@ test('replace', 'one!two!three!', 'one@two!three!', '!', '@', 1)
test('replace', 'one!two!three!', 'one@two@three!', '!', '@', 2)
test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 3)
test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 4)
-test('replace', 'one!two!three!', 'one!two!three!', '!', '@', 0)
+# CAUTION: a replace count of 0 means infinity only to strop, not to the
+# string .replace() method or to the string.replace() function.
+test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 0)
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)