mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Maintain peepholer's cumlc invariant by updating the running total
everytime a LOAD_CONSTANT is encountered, created, or overwritten. Added two tests to cover cases affected by the patch.
This commit is contained in:
parent
7d112df94f
commit
5dec096e6a
2 changed files with 9 additions and 3 deletions
|
|
@ -75,9 +75,11 @@ class TestTranforms(unittest.TestCase):
|
|||
|
||||
def test_folding_of_tuples_of_constants(self):
|
||||
for line, elem in (
|
||||
('a = 1,2,3', '((1, 2, 3))',),
|
||||
('("a","b","c")', "(('a', 'b', 'c'))",),
|
||||
('a,b,c = 1,2,3', '((1, 2, 3))',),
|
||||
('a = 1,2,3', '((1, 2, 3))'),
|
||||
('("a","b","c")', "(('a', 'b', 'c'))"),
|
||||
('a,b,c = 1,2,3', '((1, 2, 3))'),
|
||||
('(None, 1, None)', '((None, 1, None))'),
|
||||
('((1, 2), 3, 4)', '(((1, 2), 3, 4))'),
|
||||
):
|
||||
asm = dis_single(line)
|
||||
self.assert_(elem in asm)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue