From 1905284494b020c89e120b1caead984859121c48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20G=C3=A9czi?= Date: Thu, 29 Sep 2022 00:00:00 +0000 Subject: [PATCH] Add test for xml_node::set_value with size argument --- tests/test_dom_modify.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp index ff9d440..1ce25fe 100644 --- a/tests/test_dom_modify.cpp +++ b/tests/test_dom_modify.cpp @@ -209,6 +209,24 @@ TEST_XML(dom_node_set_value, "text") CHECK_NODE(doc, STR("no text")); } +TEST_XML(dom_node_set_value_partially_with_size, "text") +{ + 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("no")); +} + +TEST_XML(dom_node_set_value_with_size, "text") +{ + 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("no text")); +} + TEST_XML(dom_node_set_value_allocated, "text") { CHECK(doc.child(STR("node")).first_child().set_value(STR("no text")));