summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-22 11:48:19 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-22 11:48:19 +0100
commit255362d5f815ca0e04e18518bb3629d241af5117 (patch)
tree5e76d006f863c420eb5cd46a96ce2676717ee254 /test
parente94dd497e760dcc72d048989f7d5d1c7e5aab862 (diff)
corrected XML serialization for primitive text content regarding whitespace and newline handling and extended XMLTest to check that.
Diffstat (limited to 'test')
-rw-r--r--test/core/XMLTest.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/test/core/XMLTest.cpp b/test/core/XMLTest.cpp
index b11a24c..c264570 100644
--- a/test/core/XMLTest.cpp
+++ b/test/core/XMLTest.cpp
@@ -42,29 +42,21 @@ TEST(XMLNode, testSerialize)
body->addChild(div);
Rooted<Element> p{new Element{mgr, div, "p"}};
div->addChild(p);
- p->addChild(new Text(mgr, p, "my text"));
- Rooted<Element> p2{new Element{mgr, div, "p"}};
- div->addChild(p2);
- p2->addChild(new Text(mgr, p2, "my text"));
+ p->addChild(new Text(mgr, p, "A"));
+ div->addChild(new Text(mgr, div, "B"));
+ Rooted<Element> myTag{new Element{mgr, div, "myTag", {}, "myNameSpace"}};
+ div->addChild(myTag);
+ myTag->addChild(new Text(mgr, myTag, "C"));
// Now this is what we expect to see:
std::string expected{
"<?xml version=\"1.0\"?>\n"
"<html>\n"
"\t<head>\n"
- "\t\t<title>\n"
- "\t\t\tmy title\n"
- "\t\t</title>\n"
+ "\t\t<title>my title</title>\n"
"\t</head>\n"
"\t<body>\n"
- "\t\t<div class=\"content\" id=\"1\">\n"
- "\t\t\t<p>\n"
- "\t\t\t\tmy text\n"
- "\t\t\t</p>\n"
- "\t\t\t<p>\n"
- "\t\t\t\tmy text\n"
- "\t\t\t</p>\n"
- "\t\t</div>\n"
+ "\t\t<div class=\"content\" id=\"1\"><p>A</p>B<myNameSpace:myTag>C</myNameSpace:myTag></div>\n"
"\t</body>\n"
"</html>\n"};