예제 #1
0
 public void Delta1Test2()
 {
     BoyerMooreStringMatcher.Delta1 delta1 = CreateStringMatcher("LONG LONG STRING").GetDelta1();
     char[] chars = new char[] { 'L', 'O', 'N', 'G', 'S', 'T', 'R', 'I', ' ' };
     CollectionAssertEx.AreEqual(new int[] { 10, 9, 1, 0, 5, 4, 3, 2, 6 }, chars.Select(x => delta1[x]));
     CollectionAssertEx.TrueForAllItems(CharsRange().Except(chars).Select(x => delta1[x]), x => x == 16);
 }
예제 #2
0
 public void Delta1Test1()
 {
     BoyerMooreStringMatcher.Delta1 delta1 = CreateStringMatcher("TEXT").GetDelta1();
     char[] chars = new char[] { 'T', 'X', 'E' };
     CollectionAssertEx.AreEqual(new int[] { 0, 1, 2 }, chars.Select(x => delta1[x]));
     CollectionAssertEx.TrueForAllItems(CharsRange().Except(chars).Select(x => delta1[x]), x => x == 4);
 }