Skip to content
Snippets Groups Projects
Commit 87d4f031 authored by Arseny Kapoulkine's avatar Arseny Kapoulkine
Browse files

tests: Add a test for printing comments that contain --

git-svn-id: https://pugixml.googlecode.com/svn/trunk@1059 99668b35-9821-0410-8761-19e4c4f06640
parent e7d2540c
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,29 @@ TEST_XML_FLAGS(write_comment, "<!--text-->", parse_comments | parse_fragment) ...@@ -57,6 +57,29 @@ TEST_XML_FLAGS(write_comment, "<!--text-->", parse_comments | parse_fragment)
CHECK_NODE_EX(doc, STR("<!--text-->\n"), STR(""), 0); CHECK_NODE_EX(doc, STR("<!--text-->\n"), STR(""), 0);
} }
TEST(write_comment_invalid)
{
xml_document doc;
xml_node child = doc.append_child(node_comment);
CHECK_NODE(doc, STR("<!---->"));
child.set_value(STR("-"));
CHECK_NODE(doc, STR("<!--- -->"));
child.set_value(STR("--"));
CHECK_NODE(doc, STR("<!--- - -->"));
child.set_value(STR("---"));
CHECK_NODE(doc, STR("<!--- - - -->"));
child.set_value(STR("-->"));
CHECK_NODE(doc, STR("<!--- ->-->"));
child.set_value(STR("-->-"));
CHECK_NODE(doc, STR("<!--- ->- -->"));
}
TEST_XML_FLAGS(write_pi, "<?name value?>", parse_pi | parse_fragment) TEST_XML_FLAGS(write_pi, "<?name value?>", parse_pi | parse_fragment)
{ {
CHECK_NODE(doc, STR("<?name value?>")); CHECK_NODE(doc, STR("<?name value?>"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment