示例#1
0
 def match_statement(self, expected, characters):
     parser = Parser()
     parser.parse(characters)
     self.assertEqual(expected, parser.all_statements[-1][0])
示例#2
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"])
示例#3
0
 def status_error(self, str_to_parse):
     parser = Parser()
     result = parser.parse(str_to_parse)
     self.assertEqual(const.ERROR, result["Status"])
示例#4
0
 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])