Skip to content

Commit 4b82bb3

Browse files
committed
Fix tests
1 parent 921ad6e commit 4b82bb3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

parser/grammar_data_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ var grammarTestData = []struct {
3333
{"b'abc' b'''123'''", "eval", "Expression(body=Bytes(s=b'abc123'))", nil, ""},
3434
{"1234", "eval", "Expression(body=Num(n=1234))", nil, ""},
3535
{"01234", "eval", "", py.SyntaxError, "illegal decimal with leading zero"},
36-
{"1234d", "eval", "", py.SyntaxError, "invalid syntax"},
37-
{"1234d", "exec", "", py.SyntaxError, "invalid syntax"},
36+
{"1234d", "eval", "", py.SyntaxError, "unexpected EOF while parsing"},
37+
{"1234d", "exec", "", py.SyntaxError, "unexpected EOF while parsing"},
3838
{"1234d", "single", "", py.SyntaxError, "unexpected EOF while parsing"},
3939
{"0x1234", "eval", "Expression(body=Num(n=4660))", nil, ""},
4040
{"12.34", "eval", "Expression(body=Num(n=12.34))", nil, ""},
@@ -325,10 +325,10 @@ var grammarTestData = []struct {
325325
{"pass\n", "single", "Interactive(body=[Pass()])", nil, ""},
326326
{"if True:\n pass\n\n", "single", "Interactive(body=[If(test=NameConstant(value=True), body=[Pass()], orelse=[])])", nil, ""},
327327
{"while True:\n pass\nelse:\n return\n", "single", "Interactive(body=[While(test=NameConstant(value=True), body=[Pass()], orelse=[Return(value=None)])])", nil, ""},
328-
{"a='potato", "eval", "", py.SyntaxError, "invalid syntax"},
328+
{"a='potato", "eval", "", py.SyntaxError, "unexpected EOF while parsing"},
329329
{"a='potato", "exec", "", py.SyntaxError, "EOL while scanning string literal"},
330330
{"a='potato", "single", "", py.SyntaxError, "EOL while scanning string literal"},
331-
{"a='''potato", "eval", "", py.SyntaxError, "invalid syntax"},
331+
{"a='''potato", "eval", "", py.SyntaxError, "unexpected EOF while parsing"},
332332
{"a='''potato", "exec", "", py.SyntaxError, "EOF while scanning triple-quoted string literal"},
333333
{"a='''potato", "single", "", py.SyntaxError, "EOF while scanning triple-quoted string literal"},
334334
}

0 commit comments

Comments
 (0)