public void AOrABAlternationOnB(string word, bool expectedMatch) { var b = new State("B", new Alternation(new RegexLiteral("b"), new RegexLiteral(""))); var a = new State("A", new Concat(new RegexLiteral("a"), new PushState(b))); var states = new[] { a, b }; Regex ab = states.ToRegex(); Assert.AreEqual(expectedMatch, ab.IsMatch(word)); }
public void A(string word, bool expectedMatch) { var states = new[] { new State("A", new RegexLiteral("a")) }; Regex a = states.ToRegex(); Assert.AreEqual(expectedMatch, a.IsMatch(word)); }