]> granicus.if.org Git - python/commitdiff
Test for more edge strip cases; leading and trailing separator gets removed
authorAndrew Dalke <dalke@dalkescientific.com>
Fri, 26 May 2006 16:22:52 +0000 (16:22 +0000)
committerAndrew Dalke <dalke@dalkescientific.com>
Fri, 26 May 2006 16:22:52 +0000 (16:22 +0000)
even with strip(..., 0)

Lib/test/string_tests.py

index 2469830d01eeef0acb292dc41188d1f860296ee0..e242170dd8476ade722e0610b3900d494a9c5a50 100644 (file)
@@ -246,6 +246,7 @@ class CommonTest(unittest.TestCase):
         self.checkequal(['a', 'b', 'c', 'd'], 'a b c d', 'split', None,
                         sys.maxint-1)
         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, 0)
         self.checkequal(['a', 'b', 'c  d'], 'a  b  c  d', 'split', None, 2)
 
         self.checkequal([], '         ', 'split')
@@ -332,6 +333,7 @@ class CommonTest(unittest.TestCase):
         self.checkequal(['a', 'b', 'c', 'd'], 'a b c d', 'rsplit', None,
                         sys.maxint-20)
         self.checkequal(['a b c d'], 'a b c d', 'rsplit', None, 0)
+        self.checkequal(['a b c d'], 'a b c d  ', 'rsplit', None, 0)
         self.checkequal(['a  b', 'c', 'd'], 'a  b  c  d', 'rsplit', None, 2)
 
         self.checkequal([], '         ', 'rsplit')