diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_dom_modify.cpp | 1 | ||||
| -rw-r--r-- | tests/test_dom_traverse.cpp | 3 | ||||
| -rw-r--r-- | tests/test_write.cpp | 20 | ||||
| -rw-r--r-- | tests/test_xpath.cpp | 5 | ||||
| -rw-r--r-- | tests/test_xpath_api.cpp | 1 | 
5 files changed, 29 insertions, 1 deletions
| diff --git a/tests/test_dom_modify.cpp b/tests/test_dom_modify.cpp index 38cc89e..5a5d3ff 100644 --- a/tests/test_dom_modify.cpp +++ b/tests/test_dom_modify.cpp @@ -163,6 +163,7 @@ TEST_XML(dom_node_append_copy_attribute, "<node a1='v1'><child a2='v2'/><child/>  	CHECK(xml_node().append_copy(xml_attribute()) == xml_attribute());  	CHECK(xml_node().append_copy(doc.child(STR("node")).attribute(STR("a1"))) == xml_attribute());  	CHECK(doc.append_copy(doc.child(STR("node")).attribute(STR("a1"))) == xml_attribute()); +	CHECK(doc.child(STR("node")).append_copy(xml_attribute()) == xml_attribute());  	xml_node node = doc.child(STR("node"));  	xml_node child = node.child(STR("child")); diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp index 8075dc3..fa6c6ef 100644 --- a/tests/test_dom_traverse.cpp +++ b/tests/test_dom_traverse.cpp @@ -577,6 +577,7 @@ TEST_XML(dom_node_path, "<node><child1>text<child2/></child1></node>")  TEST_XML(dom_node_first_element_by_path, "<node><child1>text<child2/></child1></node>")  {  	CHECK(xml_node().first_element_by_path(STR("/")) == xml_node()); +	CHECK(xml_node().first_element_by_path(STR("a")) == xml_node());  	CHECK(doc.first_element_by_path(STR("")) == doc);  	CHECK(doc.first_element_by_path(STR("/")) == doc); @@ -603,6 +604,8 @@ TEST_XML(dom_node_first_element_by_path, "<node><child1>text<child2/></child1></  	CHECK(doc.child(STR("node")).first_element_by_path(STR("child1/")) == doc.child(STR("node")).child(STR("child1")));  	CHECK(doc.child(STR("node")).first_element_by_path(STR("child")) == xml_node());  	CHECK(doc.child(STR("node")).first_element_by_path(STR("child11")) == xml_node()); + +	CHECK(doc.first_element_by_path(STR("//node")) == doc.child(STR("node")));  }  struct test_walker: xml_tree_walker diff --git a/tests/test_write.cpp b/tests/test_write.cpp index c549a82..4237739 100644 --- a/tests/test_write.cpp +++ b/tests/test_write.cpp @@ -366,3 +366,23 @@ TEST(write_no_name_attribute)  	CHECK_NODE(doc, STR("<root :anonymous=\"\" />"));  } + +TEST(write_print_empty) +{ +	test_writer writer; +	xml_node().print(writer); +} + +#ifndef PUGIXML_NO_STL +TEST(write_print_stream_empty) +{ +	std::ostringstream oss; +	xml_node().print(oss); +} + +TEST(write_print_stream_empty_wide) +{ +	std::basic_ostringstream<wchar_t> oss; +	xml_node().print(oss); +} +#endif diff --git a/tests/test_xpath.cpp b/tests/test_xpath.cpp index fe0a25f..29e7244 100644 --- a/tests/test_xpath.cpp +++ b/tests/test_xpath.cpp @@ -267,4 +267,9 @@ TEST(xpath_miscellaneous)  	CHECK_XPATH_NODESET(xml_node(), STR("foo/@FOO/@bar"));  } +TEST(xpath_document_order) +{ +	CHECK(xml_attribute().document_order() == 0); +	CHECK(xml_node().document_order() == 0); +}  #endif diff --git a/tests/test_xpath_api.cpp b/tests/test_xpath_api.cpp index f7fc868..bf35b62 100644 --- a/tests/test_xpath_api.cpp +++ b/tests/test_xpath_api.cpp @@ -146,5 +146,4 @@ TEST(xpath_api_return_type)  	CHECK(xpath_query(STR("'s'")).return_type() == xpath_type_string);  	CHECK(xpath_query(STR("true()")).return_type() == xpath_type_boolean);  } -  #endif | 
