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

lukas at codespeak.net lukas at codespeak.net
Fri Oct 26 15:44:22 CEST 2007


Author: lukas
Date: Fri Oct 26 15:44:22 2007
New Revision: 48064

Modified:
   pypy/dist/pypy/lang/smalltalk/test/test_primitives.py
Log:
added tests for SIZE primitive


Modified: pypy/dist/pypy/lang/smalltalk/test/test_primitives.py
==============================================================================
--- pypy/dist/pypy/lang/smalltalk/test/test_primitives.py	(original)
+++ pypy/dist/pypy/lang/smalltalk/test/test_primitives.py	Fri Oct 26 15:44:22 2007
@@ -190,6 +190,16 @@
 def test_invalid_at_put():
     w_obj = mockclass(0).as_class_get_shadow().new()
     prim_fails(primitives.AT_PUT, [w_obj, 1, 22])
+    
+def test_size():
+    w_obj = mockclass(0, varsized=True).as_class_get_shadow().new(0)
+    assert prim(primitives.SIZE, [w_obj]).value == 0
+    w_obj = mockclass(3, varsized=True).as_class_get_shadow().new(5)
+    assert prim(primitives.SIZE, [w_obj]).value == 5
+    
+def test_size():
+    w_obj = mockclass(0).as_class_get_shadow().new(0)
+    prim_fails(primitives.SIZE, [w_obj])
 
 def test_string_at():
     assert prim(primitives.STRING_AT, ["foobar", 4]) == wrap("b")



More information about the Pypy-commit mailing list