mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-28 05:49:35 +00:00
Add test for aliasName filtering
Adds test to check if filtering by alias name works.
This commit is contained in:
@ -500,6 +500,24 @@ TEST_F(LibraryTest, filterByTags)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(LibraryTest, filterByAliasNames)
|
||||||
|
{
|
||||||
|
// filtering for one book
|
||||||
|
EXPECT_FILTER_RESULTS(kiwix::Filter().aliasNames({"zimfile"}),
|
||||||
|
"Ray Charles"
|
||||||
|
);
|
||||||
|
|
||||||
|
// filerting for more than one book
|
||||||
|
EXPECT_FILTER_RESULTS(kiwix::Filter().aliasNames({"zimfile", "example"}),
|
||||||
|
"An example ZIM archive",
|
||||||
|
"Ray Charles"
|
||||||
|
);
|
||||||
|
|
||||||
|
// filtering by alias name requires full text match
|
||||||
|
EXPECT_FILTER_RESULTS(kiwix::Filter().aliasNames({"wrong_name"}),
|
||||||
|
/* no results */
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(LibraryTest, filterByQuery)
|
TEST_F(LibraryTest, filterByQuery)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user