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