A series of tests to debug the implementation of the parser has to be written. This includes both tests for the regular commands part and for the logic part.
The tests should compare the result of running the parser on a code snippet with the expected parse tree.
Examples are placed in lib/parser_lexer/tests/commands and lib/parser_lexer/tests/formulae. Please follow this format and place the other tests in these two folders.
Since the output trees will be annotated with a position, please use the parser_command and parse_formula functions in the utils.ml file, which will remove all annotations from the ASTs. Remember to also use dummy_position in the annotations when you are defining the expected results, to avoid spurious test failures.
A series of tests to debug the implementation of the parser has to be written. This includes both tests for the regular commands part and for the logic part.
The tests should compare the result of running the parser on a code snippet with the expected parse tree. Examples are placed in
lib/parser_lexer/tests/commands
andlib/parser_lexer/tests/formulae
. Please follow this format and place the other tests in these two folders.Since the output trees will be annotated with a position, please use the
parser_command
andparse_formula
functions in theutils.ml
file, which will remove all annotations from the ASTs. Remember to also usedummy_position
in the annotations when you are defining the expected results, to avoid spurious test failures.