[pypy-svn] r72522 - pypy/trunk/pypy/interpreter/test

xoraxax at codespeak.net xoraxax at codespeak.net
Mon Mar 22 04:38:21 CET 2010


Author: xoraxax
Date: Mon Mar 22 04:38:20 2010
New Revision: 72522

Modified:
   pypy/trunk/pypy/interpreter/test/test_argument.py
Log:
Add test for unpack_cpy.

Modified: pypy/trunk/pypy/interpreter/test/test_argument.py
==============================================================================
--- pypy/trunk/pypy/interpreter/test/test_argument.py	(original)
+++ pypy/trunk/pypy/interpreter/test/test_argument.py	Mon Mar 22 04:38:20 2010
@@ -72,6 +72,9 @@
     def newdict(self):
         return {}
 
+    def newlist(self, l=[]):
+        return l
+
     def setitem(self, obj, key, value):
         obj[key] = value
 
@@ -90,6 +93,9 @@
     def int_w(self, x):
         return x
 
+    def eq_w(self, x, y):
+        return x == y
+
     def isinstance(self, obj, cls):
         return isinstance(obj, cls)
 
@@ -129,6 +135,12 @@
         assert args1.keywords is args.keywords
         assert args1.keywords_w is args.keywords_w
 
+    def test_unpack_cpy(self):
+        space = DummySpace()
+        args = Arguments(space, ["0"])
+        assert space.eq_w(args.unpack_cpy(), space.newtuple([space.newlist([space.wrap("0")]), space.newdict()]))
+        assert space.eq_w(args.unpack_cpy(1), space.newtuple([space.newlist(), space.newdict()]))
+
     def test_fixedunpacked(self):
         space = DummySpace()
         



More information about the Pypy-commit mailing list