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

Unified Diff: test/filterStorage_readwrite.js

Issue 30013625: Issue 7094 - Link filters with subscriptions in INI parser (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Minor formatting change Created Feb. 22, 2019, 2:55 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/iniParser.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterStorage_readwrite.js
===================================================================
--- a/test/filterStorage_readwrite.js
+++ b/test/filterStorage_readwrite.js
@@ -178,16 +178,39 @@
for (let line of lines)
importer(line);
importer(null);
test.equal(filterStorage.fileProperties.version, filterStorage.formatVersion, "File format version");
let exported = Array.from(filterStorage.exportData());
test.deepEqual(canonize(exported), canonize(lines), "Import/export result");
+
+ // Make sure the relationships between filters and subscriptions are set
+ // up.
+ for (let subscription of filterStorage.subscriptions())
+ {
+ for (let text of subscription.filterText())
+ {
+ let found = false;
+
+ for (let filterSubscription of Filter.fromText(text).subscriptions())
+ {
+ if (filterSubscription == subscription)
+ {
+ found = true;
+ break;
+ }
+ }
+
+ test.ok(found, "Filter " + JSON.stringify(text) + " " +
+ "should be linked to its subscription " +
+ subscription.url);
hub 2019/02/22 15:28:04 I think using a template string here would be clea
Manish Jethani 2019/02/22 15:48:38 Done.
+ }
+ }
}
catch (error)
{
unexpectedError.call(test, error);
}
test.done();
};
« no previous file with comments | « lib/iniParser.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld