[pypy-svn] r48075 - pypy/dist/pypy/lang/smalltalk/test

lukas at codespeak.net lukas at codespeak.net
Fri Oct 26 17:10:07 CEST 2007


Author: lukas
Date: Fri Oct 26 17:10:07 2007
New Revision: 48075

Modified:
   pypy/dist/pypy/lang/smalltalk/test/test_interpreter.py
Log:
added tests for bytecodes #+, #*, #class


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 17:10:07 2007
@@ -256,6 +256,26 @@
     interp.step()
     interp.step()
     assert interp.w_active_context.stack[0].value == 4
+ 
+def test_bytecodePrimClass():
+    interp = new_interpreter(pushConstantOneBytecode + bytecodePrimClass)
+    interp.step()
+    interp.step()
+    assert interp.w_active_context.stack[0] == ct.w_SmallInteger
+    
+def test_bytecodePrimSubtract():
+    interp = new_interpreter(pushConstantOneBytecode + pushConstantTwoBytecode + bytecodePrimSubtract)
+    interp.step()
+    interp.step()
+    interp.step()
+    assert interp.w_active_context.stack[0].value == -1
+
+def test_bytecodePrimMultiply():
+    interp = new_interpreter(pushConstantMinusOneBytecode + pushConstantTwoBytecode + bytecodePrimMultiply)
+    interp.step()
+    interp.step()
+    interp.step()
+    assert interp.w_active_context.stack[0].value == -2
 
 # w_class - the class from which the method is going to be called
 # (and on which it is going to be installed)



More information about the Pypy-commit mailing list