]> granicus.if.org Git - python/commitdiff
Test cases for off-by-one errors in string split with multicharacter pattern.
authorAndrew Dalke <dalke@dalkescientific.com>
Fri, 26 May 2006 12:31:00 +0000 (12:31 +0000)
committerAndrew Dalke <dalke@dalkescientific.com>
Fri, 26 May 2006 12:31:00 +0000 (12:31 +0000)
Lib/test/string_tests.py

index 42a94009d3924ceeef963dbee584e91d27a80b42..3a97462a6a7871c42e3765c2e8f1006a1c8eaba4 100644 (file)
@@ -297,6 +297,8 @@ class CommonTest(unittest.TestCase):
         self.checkequal(['aaaa'], 'aaaa', 'split', 'aab')
         self.checkequal([''], '', 'split', 'aaa')
         self.checkequal(['aa'], 'aa', 'split', 'aaa')
+        self.checkequal(['A', 'bobb'], 'Abbobbbobb', 'split', 'bbobb')
+        self.checkequal(['A', 'B', ''], 'AbbobbBbbobb', 'split', 'bbobb')
 
         self.checkequal(['a']*20, ('aBLAH'*20)[:-4], 'split', 'BLAH')
         self.checkequal(['a']*20, ('aBLAH'*20)[:-4], 'split', 'BLAH', 19)