summaryrefslogtreecommitdiffstats
path: root/Lib/dos-8x3/test_str.py
diff options
context:
space:
mode:
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 efc98ff..a4f1882 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