Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
 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));
 }