summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_deque.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_deque.py')
-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 8718716..c61e80b 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -654,6 +654,15 @@ class TestBasic(unittest.TestCase):
self.assertNotEqual(id(d), id(e))
self.assertEqual(list(d), list(e))
+ for i in range(5):
+ for maxlen in range(-1, 6):
+ s = [random.random() for j in range(i)]
+ d = deque(s) if maxlen == -1 else deque(s, maxlen)
+ e = d.copy()
+ self.assertEqual(d, e)
+ self.assertEqual(d.maxlen, e.maxlen)
+ self.assertTrue(all(x is y for x, y in zip(d, e)))
+
def test_copy_method(self):
mut = [10]
d = deque([mut])