]> granicus.if.org Git - python/commitdiff
Add test for ea064ff3c10f
authorRaymond Hettinger <python@rcn.com>
Mon, 9 Jan 2017 15:50:19 +0000 (07:50 -0800)
committerRaymond Hettinger <python@rcn.com>
Mon, 9 Jan 2017 15:50:19 +0000 (07:50 -0800)
Lib/test/test_functools.py

index 9f4899ee7391971bb5cd1d1f7006491e79dfc1f5..eeb3a227a2e364e1dd6c07a7afd7a8cfd8c18709 100644 (file)
@@ -1238,6 +1238,15 @@ class TestLRU:
         finally:
             builtins.len = old_len
 
+    def test_lru_star_arg_handling(self):
+        # Test regression that arose in ea064ff3c10f
+        @functools.lru_cache()
+        def f(*args):
+            return args
+
+        self.assertEqual(f(1, 2), (1, 2))
+        self.assertEqual(f((1, 2)), ((1, 2),))
+
     def test_lru_type_error(self):
         # Regression test for issue #28653.
         # lru_cache was leaking when one of the arguments