Add test for middomain

This commit is contained in:
Ai Lin Chia 2018-07-11 14:59:50 +02:00
parent 651e74fe08
commit 4cc156c011
2 changed files with 12 additions and 0 deletions

View File

@ -279,6 +279,17 @@ TEST(UrlMatchListTest, DomainHostSuffix) {
EXPECT_FALSE(urlMatchList.isUrlMatched("http://jostsuffix06.a.se"));
}
TEST(UrlMatchListTest, Middomain) {
TestUrlMatchList urlMatchList("blocklist/middomain.txt");
urlMatchList.load();
//middomain example
EXPECT_TRUE(urlMatchList.isUrlMatched("http://www.example.co.uk"));
EXPECT_TRUE(urlMatchList.isUrlMatched("http://www.example.dk/abc.html"));
EXPECT_TRUE(urlMatchList.isUrlMatched("https://www.example.com/"));
EXPECT_TRUE(urlMatchList.isUrlMatched("https://sub.example.com/"));
}
TEST(UrlMatchListTest, PathPath) {
TestUrlMatchList urlMatchList("blocklist/path.txt");
urlMatchList.load();

View File

@ -0,0 +1 @@
middomain example