0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-26 12:41:06 +08:00

Add test for xml_node::set_value with size argument

This commit is contained in:
Ferenc Géczi 2022-09-29 00:00:00 +00:00
parent d359402311
commit 1905284494

View File

@ -209,6 +209,24 @@ TEST_XML(dom_node_set_value, "<node>text</node>")
CHECK_NODE(doc, STR("<node>no text</node>"));
}
TEST_XML(dom_node_set_value_partially_with_size, "<node>text</node>")
{
CHECK(doc.child(STR("node")).first_child().set_value(STR("no text"), 2));
CHECK(!doc.child(STR("node")).set_value(STR("no text"), 2));
CHECK(!xml_node().set_value(STR("no text"), 2));
CHECK_NODE(doc, STR("<node>no</node>"));
}
TEST_XML(dom_node_set_value_with_size, "<node>text</node>")
{
CHECK(doc.child(STR("node")).first_child().set_value(STR("no text"), 7));
CHECK(!doc.child(STR("node")).set_value(STR("no text"), 7));
CHECK(!xml_node().set_value(STR("no text"), 7));
CHECK_NODE(doc, STR("<node>no text</node>"));
}
TEST_XML(dom_node_set_value_allocated, "<node>text</node>")
{
CHECK(doc.child(STR("node")).first_child().set_value(STR("no text")));