Update python tests to reflect grammar changes
This commit is contained in:
parent
f4740a1beb
commit
443ac1c1e5
2 changed files with 13 additions and 5 deletions
|
|
@ -168,7 +168,15 @@ describe("Parser", () => {
|
|||
tree = parser.parse("class A:\n def b():\n c()");
|
||||
assert.equal(
|
||||
tree.rootNode.toString(),
|
||||
'(module (class_definition (identifier) (function_definition (identifier) (parameters) (expression_statement (call (identifier) (argument_list))))))'
|
||||
'(module (class_definition ' +
|
||||
'name: (identifier) ' +
|
||||
'body: (block ' +
|
||||
'(function_definition ' +
|
||||
'name: (identifier) ' +
|
||||
'parameters: (parameters) ' +
|
||||
'body: (block (expression_statement (call ' +
|
||||
'function: (identifier) ' +
|
||||
'arguments: (argument_list))))))))'
|
||||
);
|
||||
}).timeout(5000);
|
||||
|
||||
|
|
|
|||
8
test/fixtures/error_corpus/python_errors.txt
vendored
8
test/fixtures/error_corpus/python_errors.txt
vendored
|
|
@ -9,9 +9,9 @@ if a is:
|
|||
---
|
||||
|
||||
(module
|
||||
(if_statement (identifier) (ERROR)
|
||||
(if_statement (identifier) (ERROR) (block
|
||||
(print_statement (identifier))
|
||||
(print_statement (identifier))))
|
||||
(print_statement (identifier)))))
|
||||
|
||||
==========================================
|
||||
errors in function definitions
|
||||
|
|
@ -24,6 +24,6 @@ def a()::
|
|||
---
|
||||
|
||||
(module
|
||||
(function_definition (identifier) (parameters) (ERROR)
|
||||
(function_definition (identifier) (parameters) (ERROR) (block
|
||||
(expression_statement (identifier))
|
||||
(expression_statement (identifier))))
|
||||
(expression_statement (identifier)))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue