From 255362d5f815ca0e04e18518bb3629d241af5117 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Sun, 22 Feb 2015 11:48:19 +0100 Subject: corrected XML serialization for primitive text content regarding whitespace and newline handling and extended XMLTest to check that. --- test/core/XMLTest.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'test/core') 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 p{new Element{mgr, div, "p"}}; div->addChild(p); - p->addChild(new Text(mgr, p, "my text")); - Rooted 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 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{ "\n" "\n" "\t\n" - "\t\t\n" - "\t\t\tmy title\n" - "\t\t\n" + "\t\tmy title\n" "\t\n" "\t\n" - "\t\t
\n" - "\t\t\t

\n" - "\t\t\t\tmy text\n" - "\t\t\t

\n" - "\t\t\t

\n" - "\t\t\t\tmy text\n" - "\t\t\t

\n" - "\t\t
\n" + "\t\t

A

BC
\n" "\t\n" "\n"}; -- cgit v1.2.3