diff --git a/tests/test_dom_text.cpp b/tests/test_dom_text.cpp index 6146f55..7d77c09 100644 --- a/tests/test_dom_text.cpp +++ b/tests/test_dom_text.cpp @@ -269,6 +269,26 @@ TEST_XML(dom_text_set_with_size, "") CHECK_NODE(node, STR("foobarfoobar")); } +TEST_XML(dom_text_set_partially_with_size, "") +{ + xml_node node = doc.child(STR("node")); + xml_text t = node.text(); + + t.set(STR("foo"), 0); + CHECK(node.first_child().type() == node_pcdata); + CHECK_NODE(node, STR("")); + + t.set(STR("boofoo"), 3); + CHECK(node.first_child().type() == node_pcdata); + CHECK(node.first_child() == node.last_child()); + CHECK_NODE(node, STR("boo")); + + t.set(STR("foobarfoobar"), 3); + CHECK(node.first_child().type() == node_pcdata); + CHECK(node.first_child() == node.last_child()); + CHECK_NODE(node, STR("foo")); +} + TEST_XML(dom_text_assign, "") { xml_node node = doc.child(STR("node"));