Skip to content

Commit

Permalink
Add test for aliasName filtering
Browse files Browse the repository at this point in the history
Adds test to check if filtering by alias name works.
  • Loading branch information
juuz0 committed Sep 1, 2022
1 parent 21e6eed commit 151106d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 151106d

Please sign in to comment.