Loading test_reg.py 0 → 100644 +12 −0 Original line number Diff line number Diff line from lib.parsing.parser import Parser def is_can(dfa: str) -> bool: parser = Parser() return parser.str_to_dfa(dfa).is_canonical() def test_can() -> None: assert is_can("init=1 (1,a)=1 (1,b)=2 (2,b)=1 (2,a)=1 final={2}") assert is_can("init=1 (1,b)=3 (1,a)=2 (2,b)=1 (2,a)=1 (3,a)=2 (3,b)=2 final={2}") assert not is_can("init=1 (1,b)=3 (1,c)=2 (2,b)=1 (2,a)=1 (3,a)=2 (3,b)=2 final={2}") assert not is_can("init=1 (1,a)=1 (1,b)=2 (2,b)=1 (2,b)=1 (unreach,a)=1 (unreach,b)=unreach final={2}") Loading
test_reg.py 0 → 100644 +12 −0 Original line number Diff line number Diff line from lib.parsing.parser import Parser def is_can(dfa: str) -> bool: parser = Parser() return parser.str_to_dfa(dfa).is_canonical() def test_can() -> None: assert is_can("init=1 (1,a)=1 (1,b)=2 (2,b)=1 (2,a)=1 final={2}") assert is_can("init=1 (1,b)=3 (1,a)=2 (2,b)=1 (2,a)=1 (3,a)=2 (3,b)=2 final={2}") assert not is_can("init=1 (1,b)=3 (1,c)=2 (2,b)=1 (2,a)=1 (3,a)=2 (3,b)=2 final={2}") assert not is_can("init=1 (1,a)=1 (1,b)=2 (2,b)=1 (2,b)=1 (unreach,a)=1 (unreach,b)=unreach final={2}")