diff options
author | Raymond Hettinger <python@rcn.com> | 2004-11-02 04:20:10 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-11-02 04:20:10 (GMT) |
commit | 5dec096e6a62be5769904111a16d32ee86a9ef46 (patch) | |
tree | f697e85ad339cd1c2ff4ced57ad0cbbe6edc3912 /Lib | |
parent | 7d112df94f97cec372bdb7f15eb265ded908da50 (diff) | |
download | cpython-5dec096e6a62be5769904111a16d32ee86a9ef46.zip cpython-5dec096e6a62be5769904111a16d32ee86a9ef46.tar.gz cpython-5dec096e6a62be5769904111a16d32ee86a9ef46.tar.bz2 |
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.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_peepholer.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py index 934b57c..f58fe03 100644 --- a/Lib/test/test_peepholer.py +++ b/Lib/test/test_peepholer.py @@ -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) |