Kaydet (Commit) 725fe408 authored tarafından Andrew Dalke's avatar Andrew Dalke

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

even with strip(..., 0)
üst 02758d66
......@@ -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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment