Commit 09800c86 authored by di68kap's avatar di68kap

- div. Regressionsfehler korrigiert

parent 284b0fcc
......@@ -368,7 +368,7 @@ def grammar_unit(test_unit, parser_factory, transformer_factory, report='REPORT'
include_root=True, reverse=True):
zombie = parent[ZOMBIE_TAG]
zombie.tag_name = '__TESTING_ARTIFACT__'
zombie.result = 'Artifact can be ignored. Be aware, though, that also the' \
zombie.result = 'Artifact can be ignored. Be aware, though, that also the ' \
'tree structure may not be the same as in a non-testing ' \
'environment, when a testing artifact has occurred!'
# parent.result = tuple(c for c in parent.children if c.tag_name != ZOMBIE_TAG)
......@@ -447,6 +447,9 @@ def grammar_unit(test_unit, parser_factory, transformer_factory, report='REPORT'
if "ast" in tests and len(errata) == errflag:
compare = parse_tree(get(tests, "ast", test_name))
if compare:
from DHParser.transform import traverse, remove_nodes
traverse(ast, {'*': remove_nodes({'__TESTING_ARTIFACT__'})})
traverse(compare, {'*': remove_nodes({'__TESTING_ARTIFACT__'})})
if not compare.equals(ast):
errata.append('Abstract syntax tree test "%s" for parser "%s" failed:'
'\n\tExpr.: %s\n\tExpected: %s\n\tReceived: %s'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment