diff --git a/tests/test_parser.py b/tests/test_parser.py index 2a64c77..d41b028 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -813,16 +813,15 @@ def _make_parser_test(LEXER, PARSER): def test_templates(self): g = _Lark(r""" - start: number_list "\n" number_dict + start: "[" sep{NUMBER, ","} "]" sep{item, delim}: item (delim item)* - number_list: "[" sep{NUMBER, ","} "]" - number_dict: "{" sep{(NUMBER ":" NUMBER), ";"} "}" // Just to test this NUMBER: /\d+/ %ignore " " """) - x = g.parse("[1, 2, 3, 4] {1:2, 3:4, 5:6}") - print(x) - x = g.parse("[1] {1:2}") + x = g.parse("[1, 2, 3, 4]") + self.assertSequenceEqual(x.children,['1', '2', '3', '4']) + x = g.parse("[1]") + self.assertSequenceEqual(x.children,['1']) print(x) def test_token_collision_WS(self):