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

Unified Diff: test/abp2blocklist.js

Issue 29467595: Issue 5325 - Add support for separator characters (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Created June 16, 2017, 5:25 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/abp2blocklist.js ('K') | « 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
@@ -57,19 +57,19 @@
// (4) exceptions for all rules.
testRules(test, [
"##.whatever",
"test.com###something",
"@@||special.test.com^$elemhide",
"@@||test.com^$generichide"
], [
["^https?://", "css-display-none"],
- ["^https?://([^/]+\\.)?test\\.com", "ignore-previous-rules"],
+ ["^https?://([^/]+\\.)?test\\.com([^.%A-Za-z0-9_].*)?$", "ignore-previous-rules"],
["^https?://([^/:]*\\.)?test\\.com[/:]", "css-display-none"],
- ["^https?://([^/]+\\.)?special\\.test\\.com", "ignore-previous-rules"]
+ ["^https?://([^/]+\\.)?special\\.test\\.com([^.%A-Za-z0-9_].*)?$", "ignore-previous-rules"]
], rules => rules.map(rule => [rule.trigger["url-filter"],
rule.action.type]));
testRules(test, ["#@#whatever"], []);
testRules(test, ["test.com#@#whatever"], []);
testRules(test, ["~test.com#@#whatever"], []);
// We currently completely ignore any element hiding filters that have the
@@ -157,23 +157,22 @@
{trigger: {"url-filter": ".*",
"if-domain": ["*example.com"]},
action: {type: "ignore-previous-rules"}}
]);
testRules(test, ["@@||example.com^$document,image"], [
{trigger: {"url-filter": ".*",
"if-domain": ["*example.com"]},
action: {type: "ignore-previous-rules"}},
- {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com",
- "url-filter-is-case-sensitive": true,
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com([^.%A-Za-z0-9_].*)?$",
"resource-type": ["image"]},
action: {type: "ignore-previous-rules"}}
]);
testRules(test, ["@@||example.com/path^$font,document"], [
- {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com/path",
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com/path([^.%A-Za-z0-9_].*)?$",
"resource-type": ["font"]},
action: {type: "ignore-previous-rules"}}
]);
test.done();
},
testGenericblockExceptions: function(test)
« lib/abp2blocklist.js ('K') | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld