Skip to content

Commit ffa9eaa

Browse files
committed
Add a regression test
1 parent 08696c9 commit ffa9eaa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pyformlang/cfg/tests/test_cfg.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,16 @@ def test_from_text2(self):
769769
assert cfg.contains(["a", "b"])
770770
assert ["a", "b"] in cfg
771771

772+
def test_from_text3(self):
773+
text = """
774+
S -> "TER:A" "TER:B" "VAR:a"
775+
"VAR:a" -> "TER:A" | $
776+
"""
777+
cfg = CFG.from_text(text)
778+
assert cfg.contains(["A", "B"])
779+
assert cfg.contains(["A", "B", "A"])
780+
781+
772782
def test_from_text_union(self):
773783
text = """
774784
"VAR:S" -> TER:a | b

0 commit comments

Comments
 (0)