[pypy-commit] lang-smalltalk storage: Added test for interpreter.

anton_gulenko noreply at buildbot.pypy.org
Tue Apr 1 09:41:47 CEST 2014


Author: Anton Gulenko <anton.gulenko at googlemail.com>
Branch: storage
Changeset: r732:18eb8c008b4e
Date: 2014-03-31 21:04 +0200
http://bitbucket.org/pypy/lang-smalltalk/changeset/18eb8c008b4e/

Log:	Added test for interpreter.

diff --git a/spyvm/test/test_interpreter.py b/spyvm/test/test_interpreter.py
--- a/spyvm/test/test_interpreter.py
+++ b/spyvm/test/test_interpreter.py
@@ -890,10 +890,23 @@
     s_frame.push(w(fakeliterals(space, "baz")))
     step_in_interp(s_frame)
     array = s_frame.pop()
+    assert array.size() == 3
     assert space.unwrap_array(array.at0(space, 0)) == fakeliterals(space, "egg")
     assert space.unwrap_array(array.at0(space, 1)) == fakeliterals(space, "bar")
     assert space.unwrap_array(array.at0(space, 2)) == fakeliterals(space, "baz")
 
+def test_bc_pushNewArrayBytecode_noPopIntoArray(bytecode=pushNewArrayBytecode):
+    w_frame, s_frame = new_frame(bytecode + chr(0x02))
+    s_frame.push(w("egg"))
+    s_frame.push(w("bar"))
+    step_in_interp(s_frame)
+    array = s_frame.pop()
+    assert array.size() == 2
+    assert array.at0(space, 0).is_nil(space)
+    assert array.at0(space, 1).is_nil(space)
+    assert s_frame.pop().as_string() == "bar"
+    assert s_frame.pop().as_string() == "egg"
+
 def test_bc_pushNewArray(bytecode=pushNewArrayBytecode):
     w_frame, s_frame = new_frame(bytecode + chr(0x07))
     step_in_interp(s_frame)


More information about the pypy-commit mailing list