[pypy-svn] r56936 - pypy/branch/garden-call-code/pypy/interpreter/test

pedronis at codespeak.net pedronis at codespeak.net
Sat Aug 2 18:50:45 CEST 2008


Author: pedronis
Date: Sat Aug  2 18:50:44 2008
New Revision: 56936

Modified:
   pypy/branch/garden-call-code/pypy/interpreter/test/test_function.py
Log:
add a test about a corner case of prepended argument logic



Modified: pypy/branch/garden-call-code/pypy/interpreter/test/test_function.py
==============================================================================
--- pypy/branch/garden-call-code/pypy/interpreter/test/test_function.py	(original)
+++ pypy/branch/garden-call-code/pypy/interpreter/test/test_function.py	Sat Aug  2 18:50:44 2008
@@ -216,6 +216,19 @@
         assert res[0] is a
         assert res[1] == (42,)        
 
+    def test_obscure_varargs(self):
+        class A(object):
+            def func(*args):
+                return args
+        a = A()
+        res = a.func(42)
+        assert res[0] is a
+        assert res[1] == 42
+
+        res = a.func(*(42,))
+        assert res[0] is a
+        assert res[1] == 42        
+
     def test_simple_kwargs(self):
         class A(object):
             def func(self, **kwargs):



More information about the Pypy-commit mailing list