mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-26 21:04:25 +08:00
Add test for xml_text::set with size argument
This commit is contained in:
parent
f327371219
commit
09e7cc9b1c
@ -249,6 +249,26 @@ TEST_XML(dom_text_set, "<node/>")
|
||||
CHECK_NODE(node, STR("<node>foobarfoobar</node>"));
|
||||
}
|
||||
|
||||
TEST_XML(dom_text_set_with_size, "<node/>")
|
||||
{
|
||||
xml_node node = doc.child(STR("node"));
|
||||
xml_text t = node.text();
|
||||
|
||||
t.set(STR(""), 0);
|
||||
CHECK(node.first_child().type() == node_pcdata);
|
||||
CHECK_NODE(node, STR("<node></node>"));
|
||||
|
||||
t.set(STR("boo"), 3);
|
||||
CHECK(node.first_child().type() == node_pcdata);
|
||||
CHECK(node.first_child() == node.last_child());
|
||||
CHECK_NODE(node, STR("<node>boo</node>"));
|
||||
|
||||
t.set(STR("foobarfoobar"), 12);
|
||||
CHECK(node.first_child().type() == node_pcdata);
|
||||
CHECK(node.first_child() == node.last_child());
|
||||
CHECK_NODE(node, STR("<node>foobarfoobar</node>"));
|
||||
}
|
||||
|
||||
TEST_XML(dom_text_assign, "<node/>")
|
||||
{
|
||||
xml_node node = doc.child(STR("node"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user