diff options
author | Barry Warsaw <barry@python.org> | 1997-11-29 00:25:30 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1997-11-29 00:25:30 (GMT) |
commit | 9181190c76454152eed4471321dccd7d0b7ac5e9 (patch) | |
tree | 50d8150120e7f1a3c924e740a3133b1017938539 /Lib/test/test_strop.py | |
parent | f577c0868366c26dae26b7a04833f431a5c49b2e (diff) | |
download | cpython-9181190c76454152eed4471321dccd7d0b7ac5e9.zip cpython-9181190c76454152eed4471321dccd7d0b7ac5e9.tar.gz cpython-9181190c76454152eed4471321dccd7d0b7ac5e9.tar.bz2 |
Added tests of strop.replace()
Diffstat (limited to 'Lib/test/test_strop.py')
-rw-r--r-- | Lib/test/test_strop.py | 9 |
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 |