summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2011-01-25 21:43:29 (GMT)
committerRaymond Hettinger <python@rcn.com>2011-01-25 21:43:29 (GMT)
commit57a8689b55ee3a26f53b4b743901b3a55b57b46c (patch)
tree9a6f76c1a36b8a510baa7b9ca4f0cf58cd326d47 /Lib/test
parent51581de168f1c931b144fb8c61cdfbaf2c53734f (diff)
downloadcpython-57a8689b55ee3a26f53b4b743901b3a55b57b46c.zip
cpython-57a8689b55ee3a26f53b4b743901b3a55b57b46c.tar.gz
cpython-57a8689b55ee3a26f53b4b743901b3a55b57b46c.tar.bz2
Issue 11004: Fix edge case for deque.count().
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_deque.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py
index 1d3f726..a0d30f1 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -137,6 +137,15 @@ class TestBasic(unittest.TestCase):
m.d = d
self.assertRaises(RuntimeError, d.count, 3)
+ # test issue11004
+ # block advance failed after rotation aligned elements on right side of block
+ d = deque([None]*16)
+ for i in range(len(d)):
+ d.rotate(-1)
+ d.rotate(1)
+ self.assertEqual(d.count(1), 0)
+ self.assertEqual(d.count(None), 16)
+
def test_comparisons(self):
d = deque('xabc'); d.popleft()
for e in [d, deque('abc'), deque('ab'), deque(), list(d)]: