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

lukas at codespeak.net lukas at codespeak.net
Fri Oct 26 17:03:01 CEST 2007


Author: lukas
Date: Fri Oct 26 17:03:01 2007
New Revision: 48072

Modified:
   pypy/dist/pypy/lang/smalltalk/test/test_interpreter.py
Log:
added tests for bytecodes #bitAnd:, #bitOr:, #bitShift:


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:03:01 2007
@@ -235,6 +235,27 @@
     interp.step()
     interp.step()
     assert interp.w_active_context.stack == [interp.ZERO, interp.ZERO]
+    
+def test_bytecodePrimBitAnd():
+    interp = new_interpreter(pushConstantOneBytecode + pushConstantTwoBytecode + bytecodePrimBitAnd)
+    interp.step()
+    interp.step()
+    interp.step()
+    assert interp.w_active_context.stack[0].value == 0
+    
+def test_bytecodePrimBitOr():
+    interp = new_interpreter(pushConstantOneBytecode + pushConstantTwoBytecode + bytecodePrimBitOr)
+    interp.step()
+    interp.step()
+    interp.step()
+    assert interp.w_active_context.stack[0].value == 3
+
+def test_bytecodePrimBitShift():
+    interp = new_interpreter(pushConstantOneBytecode + pushConstantTwoBytecode + bytecodePrimBitShift)
+    interp.step()
+    interp.step()
+    interp.step()
+    assert interp.w_active_context.stack[0].value == 4
 
 # w_class - the class from which the method is going to be called
 # (and on which it is going to be installed)
@@ -588,5 +609,4 @@
             fakeliterals("a", wrap_char("b"))) == wrap_char("b")
     run_with_faked_methods(
         [[ct.w_String, primitives.STRING_AT_PUT, 2, "at:put:"]],
-        test)
-
+        test)
\ No newline at end of file



More information about the Pypy-commit mailing list