summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-09-21 21:52:19 +0000
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2014-09-21 21:52:19 +0000
commit27109cd6267c08e36ae8dc5b526f5878349fea85 (patch)
tree891669e6bb24063a2849e7b86952c2a16ebfceee /tests
parent3abba14e72d1eaf5578d64b531ca39bd2fdb2d95 (diff)
tests: Add test for custom indentation strings
git-svn-id: https://pugixml.googlecode.com/svn/trunk@1016 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests')
-rw-r--r--tests/test_write.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_write.cpp b/tests/test_write.cpp
index 449ad97..1009d4e 100644
--- a/tests/test_write.cpp
+++ b/tests/test_write.cpp
@@ -427,3 +427,13 @@ TEST(write_stackless)
CHECK_NODE(doc, data.c_str());
}
+
+TEST_XML(write_indent_custom, "<node attr='1'><child><sub>text</sub></child></node>")
+{
+ CHECK_NODE_EX(doc, STR("<node attr=\"1\">\n<child>\n<sub>text</sub>\n</child>\n</node>\n"), STR(""), format_indent);
+ CHECK_NODE_EX(doc, STR("<node attr=\"1\">\nA<child>\nAA<sub>text</sub>\nA</child>\n</node>\n"), STR("A"), format_indent);
+ CHECK_NODE_EX(doc, STR("<node attr=\"1\">\nAB<child>\nABAB<sub>text</sub>\nAB</child>\n</node>\n"), STR("AB"), format_indent);
+ CHECK_NODE_EX(doc, STR("<node attr=\"1\">\nABC<child>\nABCABC<sub>text</sub>\nABC</child>\n</node>\n"), STR("ABC"), format_indent);
+ CHECK_NODE_EX(doc, STR("<node attr=\"1\">\nABCD<child>\nABCDABCD<sub>text</sub>\nABCD</child>\n</node>\n"), STR("ABCD"), format_indent);
+ CHECK_NODE_EX(doc, STR("<node attr=\"1\">\nABCDE<child>\nABCDEABCDE<sub>text</sub>\nABCDE</child>\n</node>\n"), STR("ABCDE"), format_indent);
+}