Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: components/subresource_filter/core/common/fuzzy_pattern_matching_unittest.cc

Issue 2167653002: Make the subresource filter support subdomain anchor matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address more comments from engedy@ Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/subresource_filter/core/common/fuzzy_pattern_matching_unittest.cc
diff --git a/components/subresource_filter/core/common/fuzzy_pattern_matching_unittest.cc b/components/subresource_filter/core/common/fuzzy_pattern_matching_unittest.cc
index b55ffd135241fc258e9623dbaefb90331ff8968b..0dc78a50899293960682dea5f9a0e3ff199c8786 100644
--- a/components/subresource_filter/core/common/fuzzy_pattern_matching_unittest.cc
+++ b/components/subresource_filter/core/common/fuzzy_pattern_matching_unittest.cc
@@ -16,11 +16,12 @@ TEST(FuzzyPatternMatchingTest, StartsWithFuzzy) {
const char* subpattern;
bool expected_starts_with;
} kTestCases[] = {
- {"abc", "", true}, {"abc", "a", true}, {"abc", "ab", true},
- {"abc", "abc", true}, {"abc", "abcd", false}, {"abc", "abc^", true},
- {"abc", "abc^^", false}, {"abc", "abcd^", false}, {"abc", "ab^", false},
- {"abc", "bc", false}, {"abc", "bc^", false}, {"abc", "^abc", false},
+ {"abc", "", true}, {"abc", "a", true}, {"abc", "ab", true},
+ {"abc", "abc", true}, {"abc", "abcd", false}, {"abc", "abc^^", false},
+ {"abc", "abcd^", false}, {"abc", "ab^", false}, {"abc", "bc", false},
+ {"abc", "bc^", false}, {"abc", "^abc", false},
};
+ // TODO(pkalinnikov): Make end-of-string match '^' again.
for (const auto& test_case : kTestCases) {
SCOPED_TRACE(testing::Message()
@@ -39,11 +40,12 @@ TEST(FuzzyPatternMatchingTest, EndsWithFuzzy) {
const char* subpattern;
bool expected_ends_with;
} kTestCases[] = {
- {"abc", "", true}, {"abc", "c", true}, {"abc", "bc", true},
- {"abc", "abc", true}, {"abc", "0abc", false}, {"abc", "abc^", true},
- {"abc", "abc^^", false}, {"abc", "abcd^", false}, {"abc", "ab^", false},
- {"abc", "ab", false}, {"abc", "bc^", true}, {"abc", "^abc", false},
+ {"abc", "", true}, {"abc", "c", true}, {"abc", "bc", true},
+ {"abc", "abc", true}, {"abc", "0abc", false}, {"abc", "abc^^", false},
+ {"abc", "abcd^", false}, {"abc", "ab^", false}, {"abc", "ab", false},
+ {"abc", "^abc", false},
};
+ // TODO(pkalinnikov): Make end-of-string match '^' again.
for (const auto& test_case : kTestCases) {
SCOPED_TRACE(testing::Message()

Powered by Google App Engine
This is Rietveld 408576698