summaryrefslogtreecommitdiff
path: root/Lib/test/string_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/string_tests.py')
-rw-r--r--Lib/test/string_tests.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index 242a931ec6..e086994b0b 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -976,6 +976,9 @@ class MixinStrUnicodeUserStringTest:
self.checkequal(True, 'helloworld', 'startswith', 'lowo', 3)
self.checkequal(True, 'helloworld', 'startswith', 'lowo', 3, 7)
self.checkequal(False, 'helloworld', 'startswith', 'lowo', 3, 6)
+ self.checkequal(True, '', 'startswith', '', 0, 1)
+ self.checkequal(True, '', 'startswith', '', 0, 0)
+ self.checkequal(False, '', 'startswith', '', 1, 0)
# test negative indices
self.checkequal(True, 'hello', 'startswith', 'he', 0, -1)
@@ -1022,6 +1025,9 @@ class MixinStrUnicodeUserStringTest:
self.checkequal(False, 'helloworld', 'endswith', 'lowo', 3, 8)
self.checkequal(False, 'ab', 'endswith', 'ab', 0, 1)
self.checkequal(False, 'ab', 'endswith', 'ab', 0, 0)
+ self.checkequal(True, '', 'endswith', '', 0, 1)
+ self.checkequal(True, '', 'endswith', '', 0, 0)
+ self.checkequal(False, '', 'endswith', '', 1, 0)
# test negative indices
self.checkequal(True, 'hello', 'endswith', 'lo', -2)
@@ -1176,8 +1182,7 @@ class MixinStrUnicodeUserStringTest:
self.checkraises(TypeError, 'abc', '__mod__')
self.checkraises(TypeError, '%(foo)s', '__mod__', 42)
self.checkraises(TypeError, '%s%s', '__mod__', (42,))
- with self.assertWarns(DeprecationWarning):
- self.checkraises(TypeError, '%c', '__mod__', (None,))
+ self.checkraises(TypeError, '%c', '__mod__', (None,))
self.checkraises(ValueError, '%(foo', '__mod__', {})
self.checkraises(TypeError, '%(foo)s %(bar)s', '__mod__', ('foo', 42))
self.checkraises(TypeError, '%d', '__mod__', "42") # not numeric