Browse Source

Add test for multi-include

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.5.1
Kaspar Emanuel 7 years ago
parent
commit
ceae390650
2 changed files with 15 additions and 1 deletions
  1. +1
    -1
      tests/test_nearley/nearley
  2. +14
    -0
      tests/test_nearley/test_nearley.py

+ 1
- 1
tests/test_nearley/nearley

@@ -1 +1 @@
Subproject commit 0abb6e5feef2f4ebf80d5a0891c1ad709011b1c7
Subproject commit 7a13cbd325b1854b83dfe060224a2a4be5b04701

+ 14
- 0
tests/test_nearley/test_nearley.py View File

@@ -45,6 +45,20 @@ class TestNearley(unittest.TestCase):
parse('a')
parse('b')

def test_multi_include(self):
fn = os.path.join(NEARLEY_PATH, 'test/grammars/multi-include-test.ne')
with open(fn) as f:
grammar = f.read()

code = create_code_for_nearley_grammar(grammar, 'main', BUILTIN_PATH, os.path.dirname(fn))
d = {}
exec (code, d)
parse = d['parse']

parse('a')
parse('b')
parse('c')


if __name__ == '__main__':
unittest.main()

Loading…
Cancel
Save