0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-26 21:04:25 +08:00

tests: Move control char tests to test_write.cpp

Also fix code style.
This commit is contained in:
Arseny Kapoulkine 2019-03-09 06:58:07 -08:00
parent b01569918a
commit 8bf806c035
2 changed files with 10 additions and 9 deletions

View File

@ -1,9 +0,0 @@
#include "test.hpp"
TEST_XML(control_chars_skip, "<a>\f\t\n\x0F\x19</a>") {
CHECK_NODE_EX(doc.first_child(), STR("<a>\t\n</a>\n"), STR(""), pugi::format_default | pugi::format_skip_control_chars);
}
TEST_XML(control_chars_keep, "<a>\f\t\n\x0F\x19</a>") {
CHECK_NODE_EX(doc.first_child(), STR("<a>&#12;\t\n&#15;&#25;</a>\n"), STR(""), pugi::format_default);
}

View File

@ -719,3 +719,13 @@ TEST_XML(write_throw_encoding, "<node><child/></node>")
}
}
#endif
TEST_XML(write_skip_control_chars, "<a>\f\t\n\x0F\x19</a>")
{
CHECK_NODE_EX(doc.first_child(), STR("<a>\t\n</a>\n"), STR(""), pugi::format_default | pugi::format_skip_control_chars);
}
TEST_XML(write_keep_control_chars, "<a>\f\t\n\x0F\x19</a>")
{
CHECK_NODE_EX(doc.first_child(), STR("<a>&#12;\t\n&#15;&#25;</a>\n"), STR(""), pugi::format_default);
}