Skip to content

Commit 04381dc

Browse files
committed
Add more python error recovery tests
1 parent 5aa2f4d commit 04381dc

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/fixtures/error_corpus/python_errors.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ d
3939
(expression_statement (identifier))))
4040
(expression_statement (identifier)))
4141

42+
========================================================
43+
stray if keyword in function definition
44+
========================================================
45+
46+
def a():
47+
if
48+
49+
---
50+
51+
(module
52+
(function_definition
53+
name: (identifier)
54+
parameters: (parameters)
55+
(ERROR)
56+
body: (block)))
57+
4258
========================================================
4359
incomplete if statement in function definition
4460
========================================================
@@ -74,3 +90,22 @@ def a():
7490
(ERROR (identifier))
7591
body: (block
7692
(expression_statement (string)))))
93+
94+
===========================================
95+
incomplete definition in class definition
96+
===========================================
97+
98+
class A:
99+
def
100+
101+
b
102+
103+
---
104+
105+
(module
106+
(class_definition
107+
name: (identifier)
108+
(ERROR)
109+
body: (block))
110+
(expression_statement
111+
(identifier)))

0 commit comments

Comments
 (0)