[pypy-svn] r48032 - pypy/dist/pypy/lang/smalltalk/test
niko at codespeak.net
niko at codespeak.net
Fri Oct 26 11:53:40 CEST 2007
Author: niko
Date: Fri Oct 26 11:53:38 2007
New Revision: 48032
Modified:
pypy/dist/pypy/lang/smalltalk/test/test_interpreter.py
Log:
(niko, lukas)
refactor bc tests into separate calls to help with debugging
Modified: pypy/dist/pypy/lang/smalltalk/test/test_interpreter.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/test/test_interpreter.py (original)
+++ pypy/dist/pypy/lang/smalltalk/test/test_interpreter.py Fri Oct 26 11:53:38 2007
@@ -463,27 +463,32 @@
storeAssociation(doubleExtendedDoAnythingBytecode + chr(7<<5) + chr(0))
-def interp_bc_and_check_result_is_7(bcodes):
+def interp_bc_and_check_result_is_7(bcodes, literals):
bcode = "".join([chr(x) for x in bcodes])
interp = new_interpreter(bcode)
- interp.w_active_context.w_method().literals = \
- fakeliterals(wrap_int(3),
- wrap_int(4))
+ interp.w_active_context.w_method().literals = literals
res = interp.interpret()
assert res.value == 7
def test_bc_3_plus_4():
+ # [ 3+4 ] value
interp_bc_and_check_result_is_7(
- [ 137, 117, 200, 164, 4, 32, 33, 176, 125, 201, 124])
+ [ 137, 117, 200, 164, 4, 32, 33, 176, 125, 201, 124],
+ fakeliterals(wrap_int(3), wrap_int(4)))
+
def test_bc_x_plus_x_plus_1():
+ # [ :x | x+x+1 ] value: 3
interp_bc_and_check_result_is_7(
[ 137, 118, 200, 164, 7, 104, 16, 16,
- 176, 118, 176, 125, 32, 202, 124 ])
+ 176, 118, 176, 125, 32, 202, 124 ],
+ fakeliterals(wrap_int(3)))
def test_bc_x_plus_y():
- py.test.skip("not yet working")
+ # [ :x x+y ] value: 3 value: 4
+ py.test.skip("FIX")
interp_bc_and_check_result_is_7(
[ 137, 119, 200, 164, 6, 105, 104, 16, 17,
- 176, 125, 33, 34, 240, 124 ])
+ 176, 125, 33, 34, 240, 124 ],
+ fakeliterals(wrap_int(3), wrap_int(4)))
More information about the Pypy-commit
mailing list