Added more tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@406 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
a6dc5ff70b
commit
8afeb9d71a
@ -167,6 +167,7 @@ TEST_XML(dom_node_wildcard_star, "<node cd='1'/>")
|
||||
CHECK(node.attribute_w(STR("*?*d*")).as_int() == 1);
|
||||
}
|
||||
|
||||
// parse_wnorm_attribute flag
|
||||
TEST(parse_attribute_wnorm)
|
||||
{
|
||||
xml_document doc;
|
||||
@ -201,3 +202,12 @@ TEST(parse_attribute_variations_wnorm)
|
||||
}
|
||||
}
|
||||
|
||||
// document order
|
||||
TEST_XML(document_order_coverage, "<node id='1'/>")
|
||||
{
|
||||
xml_document doc;
|
||||
doc.precompute_document_order();
|
||||
|
||||
CHECK(doc.child("node").document_order() == 0);
|
||||
CHECK(doc.child("node").attribute("id").document_order() == 0);
|
||||
}
|
||||
|
||||
@ -403,6 +403,17 @@ TEST_XML(dom_node_remove_child, "<node><n1/><n2/><n3/><child><n4/></child></node
|
||||
CHECK_NODE(doc, STR("<node><n2 /><child /></node>"));
|
||||
}
|
||||
|
||||
TEST_XML(dom_node_remove_child_complex, "<node id='1'><n1 id1='1' id2='2'/><n2/><n3/><child><n4/></child></node>")
|
||||
{
|
||||
doc.child(STR("node")).remove_child(STR("n1"));
|
||||
|
||||
CHECK_NODE(doc, STR("<node id=\"1\"><n2 /><n3 /><child><n4 /></child></node>"));
|
||||
|
||||
doc.remove_child(STR("node"));
|
||||
|
||||
CHECK_NODE(doc, STR(""));
|
||||
}
|
||||
|
||||
TEST_XML(dom_node_append_copy, "<node>foo<child/></node>")
|
||||
{
|
||||
CHECK(xml_node().append_copy(xml_node()) == xml_node());
|
||||
|
||||
Loading…
Reference in New Issue
Block a user