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: Use template string Created Feb. 22, 2019, 3:47 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,37 @@
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 ${text} should be linked to subscription ${subscription.url}`);
+ }
+ }
}
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