aboutsummaryrefslogtreecommitdiff
path: root/test/adblock
diff options
context:
space:
mode:
Diffstat (limited to 'test/adblock')
-rw-r--r--test/adblock/adblocktest.cpp6
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()