summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_deque.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-08-26 15:08:38 (GMT)
committerRaymond Hettinger <python@rcn.com>2015-08-26 15:08:38 (GMT)
commit87674ec7d51eb99586231fbd6469b10d1f4fa111 (patch)
treea7230d39fc7176fcb1957713e819643bfe37cca1 /Lib/test/test_deque.py
parent9783e443bc0d653fcec508c501486f7f8ec39668 (diff)
downloadcpython-87674ec7d51eb99586231fbd6469b10d1f4fa111.zip
cpython-87674ec7d51eb99586231fbd6469b10d1f4fa111.tar.gz
cpython-87674ec7d51eb99586231fbd6469b10d1f4fa111.tar.bz2
Issue #24913: Fix overrun error in deque.index().
Diffstat (limited to 'Lib/test/test_deque.py')
-rw-r--r--Lib/test/test_deque.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py
index b858509..8718716 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -289,6 +289,11 @@ class TestBasic(unittest.TestCase):
else:
self.assertEqual(d.index(element, start, stop), target)
+ def test_insert_bug_24913(self):
+ d = deque('A' * 3)
+ with self.assertRaises(ValueError):
+ i = d.index("Hello world", 0, 4)
+
def test_insert(self):
# Test to make sure insert behaves like lists
elements = 'ABCDEFGHI'