mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
More comments added
This commit is contained in:
parent
c9919d6605
commit
8a627ac9b7
@ -72,7 +72,8 @@ static void test() {
|
||||
// usual case
|
||||
std::string text1 = "alskfjaldsabc1abc1abcbksbcdnsdabcabc";
|
||||
std::string pattern1 = "abc";
|
||||
|
||||
|
||||
// matching_indexes1 gets the indexes where pattern1 exists in text1
|
||||
std::vector<uint64_t> matching_indexes1 = find_pat_in_text(pattern1, text1);
|
||||
assert((matching_indexes1 == std::vector<uint64_t>{10, 14, 18, 30, 33}));
|
||||
|
||||
@ -80,6 +81,7 @@ static void test() {
|
||||
std::string text2 = "greengrass";
|
||||
std::string pattern2 = "abc";
|
||||
|
||||
// matching_indexes2 gets the indexes where pattern2 exists in text2
|
||||
std::vector<uint64_t> matching_indexes2 = find_pat_in_text(pattern2, text2);
|
||||
assert((matching_indexes2 == std::vector<uint64_t>{}));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user