Initial deeply busted Lilith state for LangJam
This commit is contained in:
parent
2b101bf02c
commit
43bbcda050
7 changed files with 270 additions and 0 deletions
projects/lilith/test/python
3
projects/lilith/test/python/conftest.py
Normal file
3
projects/lilith/test/python/conftest.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
"""
|
||||
Pytest fixtures.
|
||||
"""
|
26
projects/lilith/test/python/test_parser.py
Normal file
26
projects/lilith/test/python/test_parser.py
Normal 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
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue