From: Andrew Dalke Date: Fri, 26 May 2006 16:22:52 +0000 (+0000) Subject: Test for more edge strip cases; leading and trailing separator gets removed X-Git-Tag: v2.5b1~463 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=725fe4089d74f208bb820b967fd54cd982d1a26b;p=thirdparty%2FPython%2Fcpython.git Test for more edge strip cases; leading and trailing separator gets removed even with strip(..., 0) --- diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index 2469830d01ee..e242170dd847 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -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')