Test for more edge strip cases; leading and trailing separator gets removed
even with strip(..., 0)
This commit is contained in:
parent
02758d66ce
commit
725fe4089d
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue