diff --git a/tests/strings/strings.cpp b/tests/strings/strings.cpp index 98e6619a80..e1d7262bb9 100644 --- a/tests/strings/strings.cpp +++ b/tests/strings/strings.cpp @@ -35,6 +35,7 @@ private: CPPUNIT_TEST( String ); CPPUNIT_TEST( PChar ); CPPUNIT_TEST( Format ); + CPPUNIT_TEST( FormatUnicode ); CPPUNIT_TEST( Constructors ); CPPUNIT_TEST( StaticConstructors ); CPPUNIT_TEST( Extraction ); @@ -68,6 +69,7 @@ private: void String(); void PChar(); void Format(); + void FormatUnicode(); void Constructors(); void StaticConstructors(); void Extraction(); @@ -174,6 +176,20 @@ void StringTestCase::Format() ); } +void StringTestCase::FormatUnicode() +{ +#if wxUSE_UNICODE + const char *UNICODE_STR = "Iestat\xC4\xAB %i%i"; + //const char *UNICODE_STR = "Iestat\xCC\x84 %i%i"; + + wxString fmt = wxString::FromUTF8(UNICODE_STR); + wxString s = wxString::Format(fmt, 1, 1); + wxString expected(fmt); + expected.Replace("%i", "1"); + CPPUNIT_ASSERT_EQUAL( expected, s ); +#endif // wxUSE_UNICODE +} + void StringTestCase::Constructors() { CPPUNIT_ASSERT_EQUAL( "", wxString('Z', 0) );