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: Created Jan. 26, 2018, 5:32 p.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
« lib/synchronizer.js ('K') | « 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..9ca831741b625e69d9337d245494e222fc62d84b 100644
--- a/test/filterClasses.js
+++ b/test/filterClasses.js
@@ -406,3 +406,31 @@ exports.testElemHideRulesWithBraces = function(test)
);
test.done();
};
+
+exports.testFilterNormalisation = 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();
+};
« lib/synchronizer.js ('K') | « lib/synchronizer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld