summaryrefslogtreecommitdiff
path: root/Lib/dos-8x3/test_str.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-12-09 16:56:41 +0000
committerGuido van Rossum <guido@python.org>1997-12-09 16:56:41 +0000
commitb978d18fec0b583be415e20464e63f40bdc895da (patch)
tree448caa96dd1d74a303854f9568286b80ef485c4a /Lib/dos-8x3/test_str.py
parent3d20986d9664f9d6025b1f8e89fa4b3804c0cbd6 (diff)
downloadcpython-git-b978d18fec0b583be415e20464e63f40bdc895da.tar.gz
Guess... :-)
Diffstat (limited to 'Lib/dos-8x3/test_str.py')
-rw-r--r--Lib/dos-8x3/test_str.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/dos-8x3/test_str.py b/Lib/dos-8x3/test_str.py
index efc98ff04e..a4f18828e7 100644
--- a/Lib/dos-8x3/test_str.py
+++ b/Lib/dos-8x3/test_str.py
@@ -45,6 +45,12 @@ test('split', 'this is the split function',
['this', 'is', 'the', 'split', 'function'])
test('split', 'a|b|c|d', ['a', 'b', 'c', 'd'], '|')
test('split', 'a|b|c|d', ['a', 'b', 'c|d'], '|', 2)
+test('split', 'a b c d', ['a', 'b c d'], None, 1)
+test('split', 'a b c d', ['a', 'b', 'c d'], None, 2)
+test('split', 'a b c d', ['a', 'b', 'c', 'd'], None, 3)
+test('split', 'a b c d', ['a', 'b', 'c', 'd'], None, 4)
+test('split', 'a b c d', ['a', 'b', 'c', 'd'], None, 0)
+test('split', 'a b c d', ['a', 'b', 'c d'], None, 2)
# join now works with any sequence type
class Sequence:
@@ -67,6 +73,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