Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1351)

Unified Diff: Lib/test/test_peepholer.py

Issue 20094: Review issue 4715 from the public Python tracker (Closed) Base URL: http://svn.python.org/view/*checkout*/python/trunk/
Patch Set: Created 15 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Lib/test/test_peepholer.py
===================================================================
--- Lib/test/test_peepholer.py (revision 70030)
+++ Lib/test/test_peepholer.py (working copy)
@@ -19,14 +19,14 @@
class TestTranforms(unittest.TestCase):
def test_unot(self):
- # UNARY_NOT JUMP_IF_FALSE POP_TOP --> JUMP_IF_TRUE POP_TOP'
+ # UNARY_NOT POP_JUMP_IF_FALSE --> POP_JUMP_IF_TRUE'
Collin Winter 2009/02/27 21:33:21 Can you kill the lingering ' at the end of the lin
Jeffrey Yasskin 2009/02/28 01:39:00 Sure.
def unot(x):
if not x == 2:
del x
asm = disassemble(unot)
- for elem in ('UNARY_NOT', 'JUMP_IF_FALSE'):
+ for elem in ('UNARY_NOT', 'POP_JUMP_IF_FALSE'):
self.assert_(elem not in asm)
- for elem in ('JUMP_IF_TRUE', 'POP_TOP'):
+ for elem in ('POP_JUMP_IF_TRUE',):
Collin Winter 2009/02/27 21:33:21 No need for this for loop.
Jeffrey Yasskin 2009/02/28 01:39:00 True, but the other similar assertions in other te
self.assert_(elem in asm)
def test_elim_inversion_of_is_or_in(self):
@@ -56,13 +56,13 @@
self.assert_('LOAD_GLOBAL' not in disassemble(f))
def test_while_one(self):
- # Skip over: LOAD_CONST trueconst JUMP_IF_FALSE xx POP_TOP
+ # Skip over: LOAD_CONST trueconst POP_JUMP_IF_FALSE xx
def f():
while 1:
pass
return list
asm = disassemble(f)
- for elem in ('LOAD_CONST', 'JUMP_IF_FALSE'):
+ for elem in ('LOAD_CONST', 'POP_JUMP_IF_FALSE'):
self.assert_(elem not in asm)
for elem in ('JUMP_ABSOLUTE',):
self.assert_(elem in asm)

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b