From 505c46e9ba30f125f457654422f6521121a4c5f1 Mon Sep 17 00:00:00 2001 From: Erez Shinan Date: Tue, 2 Jul 2019 18:31:22 +0300 Subject: [PATCH] Cleaned up a test --- tests/test_tools.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tests/test_tools.py b/tests/test_tools.py index 27927eb..5316396 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -1,11 +1,9 @@ from __future__ import absolute_import import sys -import unittest -from unittest import TestCase +from unittest import TestCase, main from lark.tree import Tree - from lark.tools import standalone try: @@ -94,26 +92,19 @@ class TestStandalone(TestCase): _NEWLINE: /\n/ """ - # from lark import Lark - # l = Lark(grammar, parser='lalr', lexer='contextual', postlex=MyIndenter()) - # x = l.parse('(\n)\n') - # print('@@', x) - - context = self._create_standalone(grammar) _Lark = context['Lark_StandAlone'] - # l = _Lark(postlex=MyIndenter()) - # x = l.parse('()\n') - # print(x) + l = _Lark(postlex=MyIndenter()) + x = l.parse('()\n') + self.assertEqual(x, Tree('start', [])) l = _Lark(postlex=MyIndenter()) x = l.parse('(\n)\n') - print(x) - + self.assertEqual(x, Tree('start', [])) if __name__ == '__main__': - unittest.main() + main()