summaryrefslogtreecommitdiff
path: root/tests/test_write.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2016-04-14 00:30:24 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2016-04-14 00:30:24 -0700
commit2e0ed8284b7488f9664bf8dba9aae90688862cc3 (patch)
treedf01542bd9a856144ba1bd8f3e2bc1d444c7478a /tests/test_write.cpp
parentc6539ccef04ded1427831aa58404635af22e7634 (diff)
Remove extra space in an empty tag for format_raw
When using format_raw the space in the empty tag (<node />) is the only character that does not have to be there; so format_raw almost results in a minimal XML but not quite. It's pretty unlikely that this is crucial for any users - the formatting change should be benign, and it's better to improve format_raw than to add yet another flag. Fixes #87.
Diffstat (limited to 'tests/test_write.cpp')
-rw-r--r--tests/test_write.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_write.cpp b/tests/test_write.cpp
index df7b0b1..341a4f0 100644
--- a/tests/test_write.cpp
+++ b/tests/test_write.cpp
@@ -192,12 +192,12 @@ TEST_XML(write_escape_unicode, "<node attr='&#x3c00;'/>")
{
#ifdef PUGIXML_WCHAR_MODE
#ifdef U_LITERALS
- CHECK_NODE(doc, STR("<node attr=\"\u3c00\" />"));
+ CHECK_NODE(doc, STR("<node attr=\"\u3c00\"/>"));
#else
- CHECK_NODE(doc, STR("<node attr=\"\x3c00\" />"));
+ CHECK_NODE(doc, STR("<node attr=\"\x3c00\"/>"));
#endif
#else
- CHECK_NODE(doc, STR("<node attr=\"\xe3\xb0\x80\" />"));
+ CHECK_NODE(doc, STR("<node attr=\"\xe3\xb0\x80\"/>"));
#endif
}
@@ -473,7 +473,7 @@ TEST(write_no_name_element)
root.append_child();
root.append_child().append_child(node_pcdata).set_value(STR("text"));
- CHECK_NODE(doc, STR("<:anonymous><:anonymous /><:anonymous>text</:anonymous></:anonymous>"));
+ CHECK_NODE(doc, STR("<:anonymous><:anonymous/><:anonymous>text</:anonymous></:anonymous>"));
CHECK_NODE_EX(doc, STR("<:anonymous>\n\t<:anonymous />\n\t<:anonymous>text</:anonymous>\n</:anonymous>\n"), STR("\t"), format_default);
}
@@ -491,7 +491,7 @@ TEST(write_no_name_attribute)
doc.append_child().set_name(STR("root"));
doc.child(STR("root")).append_attribute(STR(""));
- CHECK_NODE(doc, STR("<root :anonymous=\"\" />"));
+ CHECK_NODE(doc, STR("<root :anonymous=\"\"/>"));
}
TEST(write_print_empty)
@@ -596,7 +596,7 @@ TEST(write_pcdata_whitespace_fixedpoint)
TEST_XML_FLAGS(write_mixed, "<node><child1/><child2>pre<![CDATA[data]]>mid<!--comment--><test/>post<?pi value?>fin</child2><child3/></node>", parse_full)
{
- CHECK_NODE(doc, STR("<node><child1 /><child2>pre<![CDATA[data]]>mid<!--comment--><test />post<?pi value?>fin</child2><child3 /></node>"));
+ CHECK_NODE(doc, STR("<node><child1/><child2>pre<![CDATA[data]]>mid<!--comment--><test/>post<?pi value?>fin</child2><child3/></node>"));
CHECK_NODE_EX(doc, STR("<node>\n<child1 />\n<child2>pre<![CDATA[data]]>mid<!--comment-->\n<test />post<?pi value?>fin</child2>\n<child3 />\n</node>\n"), STR("\t"), 0);
CHECK_NODE_EX(doc, STR("<node>\n\t<child1 />\n\t<child2>pre<![CDATA[data]]>mid<!--comment-->\n\t\t<test />post<?pi value?>fin</child2>\n\t<child3 />\n</node>\n"), STR("\t"), format_indent);
}