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

Unified Diff: test/abp2blocklist.js

Issue 29443587: Noissue - Do not add subdomain wildcard if subdomain excluded (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Add unit tests Created May 21, 2017, 9:43 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
« no previous file with comments | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/abp2blocklist.js
===================================================================
--- a/test/abp2blocklist.js
+++ b/test/abp2blocklist.js
@@ -215,16 +215,24 @@
{
testRules(test, ["1$domain=foo.com"], ["*foo.com"],
rules => rules[0]["trigger"]["if-domain"]);
testRules(test, ["2$third-party"], ["third-party"],
rules => rules[0]["trigger"]["load-type"]);
testRules(test, ["foo$match_case"], true,
rules => rules[0]["trigger"]["url-filter-is-case-sensitive"]);
+ // Test subdomain exceptions.
+ testRules(test, ["1$domain=foo.com|~bar.foo.com"],
+ ["foo.com", "www.foo.com"],
+ rules => rules[0]["trigger"]["if-domain"]);
+ testRules(test, ["1$domain=foo.com|~www.foo.com"],
+ ["foo.com"],
+ rules => rules[0]["trigger"]["if-domain"]);
+
test.done();
},
testUnicode: function(test)
{
testRules(test, ["$domain=🐈.cat"], ["*xn--zn8h.cat"],
rules => rules[0]["trigger"]["if-domain"]);
testRules(test, ["🐈$domain=🐈.cat"], []);
« no previous file with comments | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld