//Tests if KMP just passes by public void RunTest() { string s = " ABC ABCDAB ABCDABCDABDE"; string pattern = "ABCDABD"; KMP.Find(pattern, s); }
public void TestIndex() { string s = "ABC ABCDAB ABCDABCDABDE"; string pattern = "ABCDABD"; Assert.AreEqual(15, KMP.Find(pattern, s)); }
public void Find_MatchSubstringWithTableLookup_ReturnsTrue() { Assert.AreEqual(KMP.Find("ababab", "abacaabababab"), 5); }
public void Find_MatchWithTableLookup_ReturnsTrue() { Assert.AreEqual(KMP.Find("AAACAAAA", "AAAAACAAAA"), 2); }
public void Find_NoMatch_ReturnsFalse() { Assert.AreEqual(KMP.Find("ab", "vvvvvvv"), -1); }
public void Find_SubstringMatchNoBackTracking_ReturnsTrue() { Assert.AreEqual(KMP.Find("ab", "jdhfgfabsdkfh"), 6); }
public void Find_PerfectMatch_ReturnsTrue() { Assert.AreEqual(KMP.Find("AAACAAAA", "AAACAAAA"), 0); }