summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1997-11-29 00:25:30 (GMT)
committerBarry Warsaw <barry@python.org>1997-11-29 00:25:30 (GMT)
commit9181190c76454152eed4471321dccd7d0b7ac5e9 (patch)
tree50d8150120e7f1a3c924e740a3133b1017938539 /Lib/test
parentf577c0868366c26dae26b7a04833f431a5c49b2e (diff)
downloadcpython-9181190c76454152eed4471321dccd7d0b7ac5e9.zip
cpython-9181190c76454152eed4471321dccd7d0b7ac5e9.tar.gz
cpython-9181190c76454152eed4471321dccd7d0b7ac5e9.tar.bz2
Added tests of strop.replace()
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_strop.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_strop.py b/Lib/test/test_strop.py
index efc98ff..9243ff4 100644
--- a/Lib/test/test_strop.py
+++ b/Lib/test/test_strop.py
@@ -67,6 +67,15 @@ test('rstrip', ' hello ', ' hello')
test('swapcase', 'HeLLo cOmpUteRs', 'hEllO CoMPuTErS')
test('translate', 'xyzabcdef', 'xyzxyz', transtable, 'def')
+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)
+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)
+
strop.whitespace
strop.lowercase
strop.uppercase