diff --git a/tests/test_dom_text.cpp b/tests/test_dom_text.cpp index c71e54e..6146f55 100644 --- a/tests/test_dom_text.cpp +++ b/tests/test_dom_text.cpp @@ -249,6 +249,26 @@ TEST_XML(dom_text_set, "") CHECK_NODE(node, STR("foobarfoobar")); } +TEST_XML(dom_text_set_with_size, "") +{ + 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("")); + + t.set(STR("boo"), 3); + CHECK(node.first_child().type() == node_pcdata); + CHECK(node.first_child() == node.last_child()); + CHECK_NODE(node, STR("boo")); + + t.set(STR("foobarfoobar"), 12); + CHECK(node.first_child().type() == node_pcdata); + CHECK(node.first_child() == node.last_child()); + CHECK_NODE(node, STR("foobarfoobar")); +} + TEST_XML(dom_text_assign, "") { xml_node node = doc.child(STR("node"));