tests/basics/fun_callstardblstar: Add coverage test.
This fixes code coverage for the case where a *arg without __len__ is unpacked and uses exactly the amount of memory that was allocated for kw args. This triggers the code branch where the memory for the kw args gets reallocated since it was used already by the *arg unpacking. Signed-off-by: David Lechner <david@pybricks.com>
This commit is contained in:
parent
9b74d71aa7
commit
47685180f0
|
@ -25,3 +25,12 @@ try:
|
|||
eval("a.f(**{'a': 1}, *(2, 3, 4))")
|
||||
except SyntaxError:
|
||||
print("SyntaxError")
|
||||
|
||||
|
||||
# coverage test for arg allocation corner case
|
||||
|
||||
def f2(*args, **kwargs):
|
||||
print(len(args), len(kwargs))
|
||||
|
||||
|
||||
f2(*iter(range(4)), **{'a': 1})
|
||||
|
|
Loading…
Reference in New Issue