From 9181190c76454152eed4471321dccd7d0b7ac5e9 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sat, 29 Nov 1997 00:25:30 +0000 Subject: [PATCH] Added tests of strop.replace() --- Lib/test/test_strop.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Lib/test/test_strop.py b/Lib/test/test_strop.py index efc98ff04e6..9243ff48ef0 100644 --- a/Lib/test/test_strop.py +++ b/Lib/test/test_strop.py @@ -67,6 +67,15 @@ def __getitem__(self, i): return self.seq[i] 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