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(); |
+}; |