From 2388960a08b4247851f588f8d9f078ff7ae7ff21 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 21 Jul 2009 11:26:01 +0000 Subject: [PATCH] added a test for white space after CDATA (see #10552) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61487 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- tests/xml/xmltest.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/xml/xmltest.cpp b/tests/xml/xmltest.cpp index 6d7faeb3c8..d8cda12b03 100644 --- a/tests/xml/xmltest.cpp +++ b/tests/xml/xmltest.cpp @@ -75,11 +75,13 @@ private: CPPUNIT_TEST( InsertChild ); CPPUNIT_TEST( InsertChildAfter ); CPPUNIT_TEST( LoadSave ); + CPPUNIT_TEST( CDATA ); CPPUNIT_TEST_SUITE_END(); void InsertChild(); void InsertChildAfter(); void LoadSave(); + void CDATA(); DECLARE_NO_COPY_CLASS(XmlTestCase) }; @@ -189,3 +191,26 @@ void XmlTestCase::LoadSave() wxString(sos8.GetString().ToUTF8()) ); } +void XmlTestCase::CDATA() +{ + const char *xmlText = + "\n" + "\n" + " \n" + "\n" + ; + + wxStringInputStream sis(xmlText); + wxXmlDocument doc; + CPPUNIT_ASSERT( doc.Load(sis) ); + + wxXmlNode *n = doc.GetRoot(); + CPPUNIT_ASSERT( n ); + + n = n->GetChildren(); + CPPUNIT_ASSERT( n ); + + // currently leading white space is stripped by trailing is preserved (see + // #10552) + CPPUNIT_ASSERT_EQUAL( "Giovanni Mittone\n", n->GetContent() ); +} -- 2.45.2