mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-27 21:39:37 +00:00
Enter Book::getLanguages()
This commit is contained in:
committed by
Matthieu Gautier
parent
12826a57bd
commit
b1ad319d52
@ -195,3 +195,22 @@ TEST(BookTest, getHumanReadableIdFromPath)
|
||||
#endif
|
||||
EXPECT_EQ("3plus2", path2HumanReadableId("3+2.zim"));
|
||||
}
|
||||
|
||||
TEST(BookTest, getLanguages)
|
||||
{
|
||||
typedef std::vector<std::string> Langs;
|
||||
|
||||
{
|
||||
const kiwix::Book book = makeBook(R"(id="abcd" language="fra")");
|
||||
|
||||
EXPECT_EQ(book.getLanguage(), "fra");
|
||||
EXPECT_EQ(book.getLanguages(), Langs{ "fra" });
|
||||
}
|
||||
|
||||
{
|
||||
const kiwix::Book book = makeBook(R"(id="abcd" language="eng,ong,ing")");
|
||||
|
||||
EXPECT_EQ(book.getLanguage(), "eng,ong,ing");
|
||||
EXPECT_EQ(book.getLanguages(), Langs({ "eng", "ong", "ing" }));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user