示例#1
0
 public virtual void TestBasicAutomata()
 {
     AssertAutomatonHits(0, BasicAutomata.MakeEmpty());
     AssertAutomatonHits(0, BasicAutomata.MakeEmptyString());
     AssertAutomatonHits(2, BasicAutomata.MakeAnyChar());
     AssertAutomatonHits(3, BasicAutomata.MakeAnyString());
     AssertAutomatonHits(2, BasicAutomata.MakeString("doc"));
     AssertAutomatonHits(1, BasicAutomata.MakeChar('a'));
     AssertAutomatonHits(2, BasicAutomata.MakeCharRange('a', 'b'));
     AssertAutomatonHits(2, BasicAutomata.MakeInterval(1233, 2346, 0));
     AssertAutomatonHits(1, BasicAutomata.MakeInterval(0, 2000, 0));
     AssertAutomatonHits(2, BasicOperations.Union(BasicAutomata.MakeChar('a'), BasicAutomata.MakeChar('b')));
     AssertAutomatonHits(0, BasicOperations.Intersection(BasicAutomata.MakeChar('a'), BasicAutomata.MakeChar('b')));
     AssertAutomatonHits(1, BasicOperations.Minus(BasicAutomata.MakeCharRange('a', 'b'), BasicAutomata.MakeChar('a')));
 }