def match_statement(self, expected, characters): parser = Parser() parser.parse(characters) self.assertEqual(expected, parser.all_statements[-1][0])
def test_simple_file(self): file = open(TESTS_RESOURCES_PATH + "/files_to_parse/simple_parsing.brs", "r+").read() parser = Parser() result = parser.parse(file) self.assertEqual("Success", result["Status"])
def status_error(self, str_to_parse): parser = Parser() result = parser.parse(str_to_parse) self.assertEqual(const.ERROR, result["Status"])
def match_program(self, expected, characters): parser = Parser() result = parser.parse(characters) self.assertEqual(const.SUCCESS, result["Status"]) self.assertEqual(expected, parser.line_reductions[-1][0])