summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_collections.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r--Lib/test/test_collections.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 4124f91..3ed3abdf 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -1995,6 +1995,20 @@ class OrderedDictTests:
with self.assertRaises(KeyError):
od.move_to_end('x', 0)
+ def test_move_to_end_issue25406(self):
+ OrderedDict = self.module.OrderedDict
+ od = OrderedDict.fromkeys('abc')
+ od.move_to_end('c', last=False)
+ self.assertEqual(list(od), list('cab'))
+ od.move_to_end('a', last=False)
+ self.assertEqual(list(od), list('acb'))
+
+ od = OrderedDict.fromkeys('abc')
+ od.move_to_end('a')
+ self.assertEqual(list(od), list('bca'))
+ od.move_to_end('c')
+ self.assertEqual(list(od), list('bac'))
+
def test_sizeof(self):
OrderedDict = self.module.OrderedDict
# Wimpy test: Just verify the reported size is larger than a regular dict