Browse Source

Add test for nearley include of unicode

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.5.1
Kaspar Emanuel 7 years ago
parent
commit
e05c62ca06
3 changed files with 8 additions and 1 deletions
  1. +3
    -0
      tests/test_nearley/grammars/include_unicode.ne
  2. +1
    -1
      tests/test_nearley/grammars/unicode.ne
  3. +4
    -0
      tests/test_nearley/test_nearley.py

+ 3
- 0
tests/test_nearley/grammars/include_unicode.ne View File

@@ -0,0 +1,3 @@
@include "unicode.ne"

main -> x

+ 1
- 1
tests/test_nearley/grammars/unicode.ne View File

@@ -1 +1 @@
main -> "±a"
x -> "±a"

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

@@ -73,6 +73,10 @@ class TestNearley(unittest.TestCase):

def test_utf8_2(self):
fn = os.path.join(TEST_PATH, 'grammars/unicode.ne')
nearley_tool_main(fn, 'x', NEARLEY_PATH)

def test_include_utf8(self):
fn = os.path.join(TEST_PATH, 'grammars/include_unicode.ne')
nearley_tool_main(fn, 'main', NEARLEY_PATH)




Loading…
Cancel
Save