mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-09 05:22:19 +08:00
Start actual testing of the new parser.
This commit is contained in:
@@ -7,7 +7,7 @@ from jedi.parser.pgen2 import Driver
|
||||
def test_basic():
|
||||
def compare(string):
|
||||
"""Generates the AST object and then regenerates the code."""
|
||||
return d.parse_string(string).get_code() == string
|
||||
assert d.parse_string(string).get_code() == string
|
||||
|
||||
#if self.options["print_function"]:
|
||||
# python_grammar = pygram.python_grammar_no_print_statement
|
||||
@@ -18,6 +18,10 @@ def test_basic():
|
||||
logger = logging.getLogger("RefactoringTool")
|
||||
d = Driver(pytree.python_grammar, convert=pytree.convert, logger=logger)
|
||||
|
||||
compare('\na #pass\n')
|
||||
compare('wblabla* 1\t\n')
|
||||
compare('def x(a, b:3): pass\n')
|
||||
|
||||
print(d)
|
||||
tree = d.parse_string('wblabla* 1\t\n')
|
||||
print(repr(tree))
|
||||
|
||||
Reference in New Issue
Block a user