public void StringMatchers_ForLargeStrings_AgreeWithEachOther() { string text = InputGenerator.GenerateRandomString(1000); string pattern = InputGenerator.GenerateRandomString(3); CollectionAssert.AreEqual( NaiveStringMatcher.GetMatchIndices(text, pattern).ToArray(), KmpStringMatcher.GetMatchIndices(text, pattern).ToArray()); text = InputGenerator.GenerateRandomString(1000, 'a', 'b'); pattern = InputGenerator.GenerateRandomString(3, 'a', 'b'); CollectionAssert.AreEqual( NaiveStringMatcher.GetMatchIndices(text, pattern).ToArray(), KmpStringMatcher.GetMatchIndices(text, pattern).ToArray()); }
private void NaiveMatcher(string text, string pattern) => NaiveStringMatcher.GetMatchIndices(text, pattern).ToArray();