Test for more edge strip cases; leading and trailing separator gets removed

even with strip(..., 0)
This commit is contained in:
Andrew Dalke 2006-05-26 16:22:52 +00:00
parent 02758d66ce
commit 725fe4089d
1 changed files with 2 additions and 0 deletions

View 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')