mirror of
https://github.com/kiwix/libkiwix.git
synced 2026-10-26 10:59:23 -04:00
Both Book::update() methods update the category
This commit is contained in:
1 parent
a870e05621
commit
b7b0bdbdd8
2 files changed
+24
No files matched your search
@@ -144,3 +144,25 @@ TEST(BookTest, updateFromXMLCategoryHandlingTest)
|
||||
EXPECT_EQ(book.getCategory(), "category_attribute_overrides_tags");
|
||||
}
|
||||
}
|
||||
|
||||
TEST(BookTest, setTagsDoesntAffectCategory)
|
||||
{
|
||||
kiwix::Book book;
|
||||
|
||||
book.setTags("_category:youtube");
|
||||
ASSERT_EQ("", book.getCategory());
|
||||
}
|
||||
|
||||
TEST(BookTest, updateCopiesCategory)
|
||||
{
|
||||
const XMLDoc xml(R"(<book id="abcd" category="ted"></book>)");
|
||||
|
||||
kiwix::Book book;
|
||||
book.updateFromXml(xml.child("book"), "");
|
||||
|
||||
kiwix::Book newBook;
|
||||
newBook.setId("abcd");
|
||||
EXPECT_EQ(newBook.getCategory(), "");
|
||||
newBook.update(book);
|
||||
EXPECT_EQ(newBook.getCategory(), "ted");
|
||||
}
|
||||
Reference in new issue
Block a user