mirror of https://github.com/kiwix/libkiwix.git
LibraryTest.{filterLocal,filterRemote}
This commit is contained in:
parent
d8fe593f59
commit
f063d350c6
|
@ -202,7 +202,6 @@ const char sampleLibraryXML[] = R"(
|
||||||
<book
|
<book
|
||||||
id="example"
|
id="example"
|
||||||
path="./example.zim"
|
path="./example.zim"
|
||||||
url="https://github.com/kiwix/kiwix-lib/raw/master/test/data/example.zim"
|
|
||||||
title="An example ZIM archive"
|
title="An example ZIM archive"
|
||||||
description="An eXaMpLe book added to the catalog via XML"
|
description="An eXaMpLe book added to the catalog via XML"
|
||||||
language="deu"
|
language="deu"
|
||||||
|
@ -302,6 +301,48 @@ TEST_F(LibraryTest, emptyFilter)
|
||||||
TitleCollection({ __VA_ARGS__ }) \
|
TitleCollection({ __VA_ARGS__ }) \
|
||||||
)
|
)
|
||||||
|
|
||||||
|
TEST_F(LibraryTest, filterLocal)
|
||||||
|
{
|
||||||
|
EXPECT_FILTER_RESULTS(kiwix::Filter().local(true),
|
||||||
|
"An example ZIM archive",
|
||||||
|
"Ray Charles"
|
||||||
|
);
|
||||||
|
|
||||||
|
EXPECT_FILTER_RESULTS(kiwix::Filter().local(false),
|
||||||
|
"Encyclopédie de la Tunisie",
|
||||||
|
"Granblue Fantasy Wiki",
|
||||||
|
"Géographie par Wikipédia",
|
||||||
|
"Islam Stack Exchange",
|
||||||
|
"Mathématiques",
|
||||||
|
"Movies & TV Stack Exchange",
|
||||||
|
"Mythology & Folklore Stack Exchange",
|
||||||
|
"TED talks - Business",
|
||||||
|
"Tania Louis",
|
||||||
|
"Wikiquote"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(LibraryTest, filterRemote)
|
||||||
|
{
|
||||||
|
EXPECT_FILTER_RESULTS(kiwix::Filter().remote(true),
|
||||||
|
"Encyclopédie de la Tunisie",
|
||||||
|
"Granblue Fantasy Wiki",
|
||||||
|
"Géographie par Wikipédia",
|
||||||
|
"Islam Stack Exchange",
|
||||||
|
"Mathématiques",
|
||||||
|
"Movies & TV Stack Exchange",
|
||||||
|
"Mythology & Folklore Stack Exchange",
|
||||||
|
"Ray Charles",
|
||||||
|
"TED talks - Business",
|
||||||
|
"Tania Louis",
|
||||||
|
"Wikiquote"
|
||||||
|
);
|
||||||
|
|
||||||
|
EXPECT_FILTER_RESULTS(kiwix::Filter().remote(false),
|
||||||
|
"An example ZIM archive"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(LibraryTest, filterByLanguage)
|
TEST_F(LibraryTest, filterByLanguage)
|
||||||
{
|
{
|
||||||
EXPECT_FILTER_RESULTS(kiwix::Filter().lang("eng"),
|
EXPECT_FILTER_RESULTS(kiwix::Filter().lang("eng"),
|
||||||
|
|
Loading…
Reference in New Issue