Add tests for r84209 (crashes in the Ast builder)

Also remove one tab, and move a check closer to the possible failure.
This commit is contained in:
Amaury Forgeot d'Arc 2010-08-19 21:32:38 +00:00
parent 8101021eae
commit 12844e6df6
2 changed files with 31 additions and 3 deletions

View file

@ -484,6 +484,34 @@ SyntaxError: can't delete ()
Traceback (most recent call last):
SyntaxError: can't assign to literal
Corner-cases that used to fail to raise the correct error:
>>> def f(*, x=lambda __debug__:0): pass
Traceback (most recent call last):
SyntaxError: assignment to keyword
>>> def f(*args:(lambda __debug__:0)): pass
Traceback (most recent call last):
SyntaxError: assignment to keyword
>>> def f(**kwargs:(lambda __debug__:0)): pass
Traceback (most recent call last):
SyntaxError: assignment to keyword
>>> with (lambda *:0): pass
Traceback (most recent call last):
SyntaxError: named arguments must follow bare *
Corner-cases that used to crash:
>>> def f(**__debug__): pass
Traceback (most recent call last):
SyntaxError: assignment to keyword
>>> def f(*xx, __debug__): pass
Traceback (most recent call last):
SyntaxError: assignment to keyword
"""
import re