Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/filterClasses.js

Issue 29680684: [$csp1 adblockpluscore] Issue 6329 - Allow whitespace in filter option values (Closed)
Patch Set: Addressed some of Manish's initial feedback Created Feb. 13, 2018, 11:55 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/synchronizer.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterClasses.js
diff --git a/test/filterClasses.js b/test/filterClasses.js
index a3726337fc282b3f6abdc87ddcd23d025a4fc988..68c42aa3f9ad8b1c24080c5cfdb61905c4d13eee 100644
--- a/test/filterClasses.js
+++ b/test/filterClasses.js
@@ -406,3 +406,31 @@ exports.testElemHideRulesWithBraces = function(test)
);
test.done();
};
+
+exports.testFilterNormalization = function(test)
+{
+ compareFilter(test, Filter.stripJunk(" domain.c om## #sele ctor "), [
+ "type=elemhide",
+ "text=domain.com###sele ctor",
+ "selectorDomain=domain.com",
+ "selector=#sele ctor",
+ "domains=DOMAIN.COM"
+ ]);
+ compareFilter(test, Filter.stripJunk(" ! fo o## bar "), [
+ "type=comment", "text=! fo o## bar"
+ ]);
+ compareFilter(test, Filter.stripJunk(" bl a$sitekey= foo ,domain= do main.com |foo .com "), [
+ "type=filterlist",
+ "text=bla$sitekey=foo,domain=domain.com|foo.com",
+ "regexp=bla",
+ "sitekeys=FOO",
+ "domains=DOMAIN.COM|FOO.COM"
+ ]);
+ compareFilter(test, Filter.stripJunk(" @@bl a$foo= bar ,domain= ab cd "), [
+ "type=invalid",
+ "text=@@bla$invalid=foo,domain=abcd",
+ "reason=filter_unknown_option"
+ ]);
+
+ test.done();
+};
« no previous file with comments | « lib/synchronizer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld