Browse Source

Cleaned up a test

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.8.7
Erez Shinan 5 years ago
parent
commit
68cee8aa6e
1 changed files with 6 additions and 15 deletions
  1. +6
    -15
      tests/test_tools.py

+ 6
- 15
tests/test_tools.py View File

@@ -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()



Loading…
Cancel
Save