summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Dalke <dalke@dalkescientific.com>2006-05-26 11:11:38 (GMT)
committerAndrew Dalke <dalke@dalkescientific.com>2006-05-26 11:11:38 (GMT)
commit984b9713412bec19f9be966a2f59ddaadf36fd5e (patch)
treeee91f55e590e23a3d3ff3a6c77026b17ca038236
parentf2c0dfdb138c44ce230d86f9429a373e6e160307 (diff)
downloadcpython-984b9713412bec19f9be966a2f59ddaadf36fd5e.zip
cpython-984b9713412bec19f9be966a2f59ddaadf36fd5e.tar.gz
cpython-984b9713412bec19f9be966a2f59ddaadf36fd5e.tar.bz2
Added a few more test cases for whitespace split. These strings have leading whitespace.
-rw-r--r--Lib/test/string_tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index 260b2d8..8f16f20 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -246,6 +246,13 @@ class CommonTest(unittest.TestCase):
self.checkequal(['a b c d'], 'a b c d', 'split', None, 0)
self.checkequal(['a', 'b', 'c d'], 'a b c d', 'split', None, 2)
+ self.checkequal([], ' ', 'split')
+ self.checkequal(['a'], ' a ', 'split')
+ self.checkequal(['a', 'b'], ' a b ', 'split')
+ self.checkequal(['a', 'b '], ' a b ', 'split', None, 1)
+ self.checkequal(['a', 'b c '], ' a b c ', 'split', None, 1)
+ self.checkequal(['a', 'b', 'c '], ' a b c ', 'split', None, 2)
+
# by a char
self.checkequal(['a', 'b', 'c', 'd'], 'a|b|c|d', 'split', '|')
self.checkequal(['a', 'b|c|d'], 'a|b|c|d', 'split', '|', 1)