1. Tohru Ike
  2. pypy

Commits

Carl Friedrich Bolz  committed 311b124

a test for _dont_jit

  • Participants
  • Parent commits 5041230
  • Branches virtual-arguments

Comments (0)

Files changed (1)

File pypy/interpreter/test/test_argument.py

View file
         return list(it)
 
     def view_as_kwargs(self, x):
+        if len(x) == 0:
+            return [], []
         return None, None
 
     def newdict(self, kwargs=False):
             assert l == [1, 2, 3, {'d': 4}]
             assert isinstance(l[-1], kwargsdict)
 
+    def test_match_kwds_creates_kwdict(self):
+        space = DummySpace()
+        kwds = [("c", 3), ('d', 4)]
+        for i in range(4):
+            kwds_w = dict(kwds[:i])
+            keywords = kwds_w.keys()
+            keywords_w = kwds_w.values()
+            w_kwds = dummy_wrapped_dict(kwds[i:])
+            if i == 3:
+                w_kwds = None
+            args = Arguments(space, [1, 2], keywords, keywords_w, w_starstararg=w_kwds)
+            assert args._dont_jit == (i != 3)
+
     def test_duplicate_kwds(self):
         space = DummySpace()
         excinfo = py.test.raises(OperationError, Arguments, space, [], ["a"],