Commit 24ea6df1 authored by Vladimír Štill's avatar Vladimír Štill
Browse files

test: Ensure combound rules are forbidden, close #3

parent db6b461f
Pipeline #95276 passed with stage
in 1 minute and 26 seconds
......@@ -21,3 +21,11 @@ def test_can() -> None:
auto_can = parse("init=x (x,a)=z (x,b)=y (y,a)=z (y,b)=z (z,a)=z (z,b)=z final={z}").canonize()
expect_can = parse("init=1 (1,a)=2 (1,b)=3 (2,a)=2 (2,b)=2 (3,a)=2 (3,b)=2 final={2}")
assert DFA.is_identical(auto_can, expect_can), f"{to_str(auto_can)}{to_str(expect_can)}"
def test_invalid() -> None:
try:
lib.parser.dfa("init=A (A,ab)=A (A,c)=B (B,ab)=B final={B}")
assert False, "should not parse (long/compound terminal)"
except:
pass
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment