[Python-checkins] r46285 - python/trunk/Lib/test/string_tests.py

andrew.dalke python-checkins at python.org
Fri May 26 13:11:38 CEST 2006


Author: andrew.dalke
Date: Fri May 26 13:11:38 2006
New Revision: 46285

Modified:
   python/trunk/Lib/test/string_tests.py
Log:
Added a few more test cases for whitespace split.  These strings have leading whitespace.


Modified: python/trunk/Lib/test/string_tests.py
==============================================================================
--- python/trunk/Lib/test/string_tests.py	(original)
+++ python/trunk/Lib/test/string_tests.py	Fri May 26 13:11:38 2006
@@ -246,6 +246,13 @@
         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)


More information about the Python-checkins mailing list