Initial deeply busted Lilith state for LangJam

This commit is contained in:
Reid 'arrdem' McKenzie 2021-08-20 23:16:59 -06:00
commit 43bbcda050
7 changed files with 270 additions and 0 deletions
projects/lilith/test/python

View file

@ -0,0 +1,3 @@
"""
Pytest fixtures.
"""

View file

@ -0,0 +1,26 @@
"""tests covering the Lilith parser."""
from lilith.parser import block_grammar, Block
import pytest
@pytest.mark.parametrize('example, result', [
('!def[syntax]',
Block('def', ['syntax'], None, [])),
('!frag[lang: md]',
Block('frag', None, {'lang': 'md'}, [])),
('!frag[foo, lang: md]',
Block('frag', ['foo'], {'lang': 'md'}, [])),
])
def test_parse_header(example, result):
assert block_grammar.parse(example) == result
(
"""!def[designdoc]
!frag[lang: md]
# Designdoc
A design document""",
None
)