From 566abfa99120652fb1e9190d791fdbbba64d2e0d Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 16 Nov 2018 16:26:22 +0100 Subject: Add adblockrule_parse --- test/adblock/adblocktest.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/adblock') 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 #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() -- cgit v1.2.1