diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-11-16 16:26:22 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-11-16 16:26:22 +0100 |
commit | 566abfa99120652fb1e9190d791fdbbba64d2e0d (patch) | |
tree | 86a6f71b926794298d922a9319b55909cf5a07b4 /test/adblock | |
parent | Add more regex benchmarks (diff) | |
download | smolbote-566abfa99120652fb1e9190d791fdbbba64d2e0d.tar.xz |
Add adblockrule_parse
Diffstat (limited to 'test/adblock')
-rw-r--r-- | test/adblock/adblocktest.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/adblock/adblocktest.cpp b/test/adblock/adblocktest.cpp index f4d9ce2..871b7ca 100644 --- a/test/adblock/adblocktest.cpp +++ b/test/adblock/adblocktest.cpp @@ -1,11 +1,15 @@ #include "adblocktest.h" #include <QtTest/QtTest> #include "formats/adblockrule.h" +#include "formats/adblockrule_parse.h" void AdBlockTest::parseRule() { - FilterLeaf *rule = loadRule("spamdomain"); + auto *rule = loadRule("/spamdomain/$domain=spamdomain.com,image"); QCOMPARE(rule != nullptr, true); + QCOMPARE(rule->match(QUrl::fromUserInput("subdomain.spamdomain.com")), true); + QCOMPARE(rule->action().first == FilterLeaf::Block, true); + QCOMPARE(rule->option(QWebEngineUrlRequestInfo::ResourceTypeImage).value(), true); } /*void AdBlockTest::parseList() |