Skip to content

Commit 8a627ac

Browse files
More comments added
1 parent c9919d6 commit 8a627ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

strings/z_function.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ static void test() {
7272
// usual case
7373
std::string text1 = "alskfjaldsabc1abc1abcbksbcdnsdabcabc";
7474
std::string pattern1 = "abc";
75-
75+
76+
// matching_indexes1 gets the indexes where pattern1 exists in text1
7677
std::vector<uint64_t> matching_indexes1 = find_pat_in_text(pattern1, text1);
7778
assert((matching_indexes1 == std::vector<uint64_t>{10, 14, 18, 30, 33}));
7879

7980
// corner case
8081
std::string text2 = "greengrass";
8182
std::string pattern2 = "abc";
8283

84+
// matching_indexes2 gets the indexes where pattern2 exists in text2
8385
std::vector<uint64_t> matching_indexes2 = find_pat_in_text(pattern2, text2);
8486
assert((matching_indexes2 == std::vector<uint64_t>{}));
8587
}

0 commit comments

Comments
 (0)