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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 testFilterOptions: function(test) 214 testFilterOptions: function(test)
215 { 215 {
216 testRules(test, ["1$domain=foo.com"], ["*foo.com"], 216 testRules(test, ["1$domain=foo.com"], ["*foo.com"],
217 rules => rules[0]["trigger"]["if-domain"]); 217 rules => rules[0]["trigger"]["if-domain"]);
218 testRules(test, ["2$third-party"], ["third-party"], 218 testRules(test, ["2$third-party"], ["third-party"],
219 rules => rules[0]["trigger"]["load-type"]); 219 rules => rules[0]["trigger"]["load-type"]);
220 testRules(test, ["foo$match_case"], true, 220 testRules(test, ["foo$match_case"], true,
221 rules => rules[0]["trigger"]["url-filter-is-case-sensitive"]); 221 rules => rules[0]["trigger"]["url-filter-is-case-sensitive"]);
222 222
223 // Test subdomain exceptions.
224 testRules(test, ["1$domain=foo.com|~bar.foo.com"],
225 ["foo.com", "www.foo.com"],
226 rules => rules[0]["trigger"]["if-domain"]);
227 testRules(test, ["1$domain=foo.com|~www.foo.com"],
228 ["foo.com"],
229 rules => rules[0]["trigger"]["if-domain"]);
230
223 test.done(); 231 test.done();
224 }, 232 },
225 233
226 testUnicode: function(test) 234 testUnicode: function(test)
227 { 235 {
228 testRules(test, ["$domain=🐈.cat"], ["*xn--zn8h.cat"], 236 testRules(test, ["$domain=🐈.cat"], ["*xn--zn8h.cat"],
229 rules => rules[0]["trigger"]["if-domain"]); 237 rules => rules[0]["trigger"]["if-domain"]);
230 testRules(test, ["🐈$domain=🐈.cat"], []); 238 testRules(test, ["🐈$domain=🐈.cat"], []);
231 testRules(test, ["###🐈"], []); 239 testRules(test, ["###🐈"], []);
232 240
233 test.done(); 241 test.done();
234 } 242 }
235 }; 243 };
OLDNEW
« 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