[pypy-svn] r66572 - pypy/branch/parser-compiler/pypy/interpreter/test
benjamin at codespeak.net
benjamin at codespeak.net
Fri Jul 24 05:13:57 CEST 2009
Author: benjamin
Date: Fri Jul 24 05:13:54 2009
New Revision: 66572
Modified:
pypy/branch/parser-compiler/pypy/interpreter/test/test_compiler.py
Log:
prevent compiler from optimizing expression out in test
Modified: pypy/branch/parser-compiler/pypy/interpreter/test/test_compiler.py
==============================================================================
--- pypy/branch/parser-compiler/pypy/interpreter/test/test_compiler.py (original)
+++ pypy/branch/parser-compiler/pypy/interpreter/test/test_compiler.py Fri Jul 24 05:13:54 2009
@@ -761,19 +761,19 @@
assert co.co_consts[2] == 2.5
def test_tuple_folding(self):
- co = compile("(1, 2, 3)", "<test>", "exec")
+ co = compile("x = (1, 2, 3)", "<test>", "exec")
assert co.co_consts == ((1, 2, 3), None)
- co = compile("()", "<test>", "exec")
+ co = compile("x = ()", "<test>", "exec")
assert co.co_consts == ((), None)
def test_unary_folding(self):
- co = compile("-(3)", "<test>", "exec")
+ co = compile("x = -(3)", "<test>", "exec")
assert co.co_consts[0] == -3
- co = compile("~3", "<test>", "exec")
+ co = compile("x = ~3", "<test>", "exec")
assert co.co_consts[0] == ~3
- co = compile("+(-3)", "<test>", "exec")
+ co = compile("x = +(-3)", "<test>", "exec")
assert co.co_consts[0] == -3
- co = compile("not None", "<test>", "exec")
+ co = compile("x = not None", "<test>", "exec")
assert co.co_consts[0] is True
def test_folding_of_binops_on_constants(self):
More information about the Pypy-commit
mailing list