summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-07-22 13:13:31 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-07-22 13:13:31 +0000
commit6b69701cdde71a96a73daa4f4d0ec39530b68a80 (patch)
treeae1f9ec2d312b36a1e840905048e559d98250aa0
parent64d98cdcfc5d4fda17a75fc89b3e9d93cbd8e03c (diff)
tests: Added more CDATA writing tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@617 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--tests/test_write.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_write.cpp b/tests/test_write.cpp
index b7d8412..c549a82 100644
--- a/tests/test_write.cpp
+++ b/tests/test_write.cpp
@@ -31,6 +31,20 @@ TEST_XML(write_cdata, "<![CDATA[value]]>")
CHECK_NODE_EX(doc, STR("<![CDATA[value]]>\n"), STR(""), 0);
}
+TEST_XML(write_cdata_empty, "<![CDATA[]]>")
+{
+ CHECK_NODE(doc, STR("<![CDATA[]]>"));
+ CHECK_NODE_EX(doc, STR("<![CDATA[]]>\n"), STR(""), 0);
+}
+
+TEST_XML(write_cdata_escape, "<![CDATA[value]]>")
+{
+ CHECK_NODE(doc, STR("<![CDATA[value]]>"));
+
+ doc.first_child().set_value(STR("1]]>2]]>3"));
+ CHECK_NODE(doc, STR("<![CDATA[1]]]]><![CDATA[>2]]]]><![CDATA[>3]]>"));
+}
+
TEST_XML_FLAGS(write_comment, "<!--text-->", parse_default | parse_comments)
{
CHECK_NODE(doc, STR("<!--text-->"));