diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-10-26 17:09:34 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-10-26 17:09:34 +0000 |
commit | 09b5dfdcb0707c39874997efbf207ff554334c34 (patch) | |
tree | 6f1ec740a22d766a419574e95122aa7322342179 /tests/test_document.cpp | |
parent | 948cb037aec073255d71a19ae1f9f5a351deff72 (diff) |
Added xml_document::reset, added append/prepend/insert child overloads for elements (with explicit name)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@779 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test_document.cpp')
-rw-r--r-- | tests/test_document.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_document.cpp b/tests/test_document.cpp index f9fcc97..342d07c 100644 --- a/tests/test_document.cpp +++ b/tests/test_document.cpp @@ -876,3 +876,33 @@ TEST_XML_FLAGS(document_element_absent, "<!---->", parse_comments) { CHECK(doc.document_element() == xml_node()); } + +TEST_XML(document_reset, "<node><child/></node>") +{ + CHECK(doc.first_child()); + + doc.reset(); + CHECK(!doc.first_child()); + CHECK_NODE(doc, STR("")); + + doc.reset(); + CHECK(!doc.first_child()); + CHECK_NODE(doc, STR("")); + + CHECK(doc.load(STR("<node/>"))); + CHECK(doc.first_child()); + CHECK_NODE(doc, STR("<node />")); + + doc.reset(); + CHECK(!doc.first_child()); + CHECK_NODE(doc, STR("")); +} + +TEST(document_reset_empty) +{ + xml_document doc; + + doc.reset(); + CHECK(!doc.first_child()); + CHECK_NODE(doc, STR("")); +} |