You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Add stripped-down test for lambda star bug
This commit is contained in:
17
test/simple_source/bug33/04_lambda_star_default.py
Normal file
17
test/simple_source/bug33/04_lambda_star_default.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# From 3.x test_audiop.py
|
||||
|
||||
# Bug is handling default value after * argument in a lambda.
|
||||
# That's a mouthful of desciption; I am not sure if the really
|
||||
# hacky fix to the code is even correct.
|
||||
#
|
||||
# FIXME: try and test with more than one default argument.
|
||||
|
||||
# RUNNABLE
|
||||
def pack(width, data):
|
||||
return (width, data)
|
||||
|
||||
packs = {w: (lambda *data, width=w: pack(width, data)) for w in (1, 2, 4)}
|
||||
|
||||
assert packs[1]('a') == (1, ('a',))
|
||||
assert packs[2]('b') == (2, ('b',))
|
||||
assert packs[4]('b') == (4, ('c',))
|
Reference in New Issue
Block a user