summaryrefslogtreecommitdiff
path: root/tests/test_dom_traverse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_dom_traverse.cpp')
-rw-r--r--tests/test_dom_traverse.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_dom_traverse.cpp b/tests/test_dom_traverse.cpp
index f977e15..773f0f0 100644
--- a/tests/test_dom_traverse.cpp
+++ b/tests/test_dom_traverse.cpp
@@ -736,6 +736,9 @@ TEST_XML(dom_node_path, "<node><child1>text<child2/></child1></node>")
CHECK(doc.child(STR("node")).child(STR("child1")).first_child().path() == STR("/node/child1/"));
CHECK(doc.child(STR("node")).child(STR("child1")).path('\\') == STR("\\node\\child1"));
+
+ doc.append_child(node_element);
+ CHECK(doc.last_child().path() == STR("/"));
}
#endif
@@ -1274,3 +1277,17 @@ TEST_XML(dom_as_int_plus, "<node attr1='+1' attr2='+0xa' />")
CHECK(node.attribute(STR("attr2")).as_ullong() == 10);
#endif
}
+
+TEST(dom_node_anonymous)
+{
+ xml_document doc;
+ doc.append_child(node_element);
+ doc.append_child(node_element);
+ doc.append_child(node_pcdata);
+
+ CHECK(doc.child(STR("node")) == xml_node());
+ CHECK(doc.first_child().next_sibling(STR("node")) == xml_node());
+ CHECK(doc.last_child().previous_sibling(STR("node")) == xml_node());
+ CHECK_STRING(doc.child_value(), STR(""));
+ CHECK_STRING(doc.last_child().child_value(), STR(""));
+}