]> git.saurik.com Git - wxWidgets.git/commitdiff
test wxString::Mid() with non-ASCII strings
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 10 May 2007 11:34:32 +0000 (11:34 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 10 May 2007 11:34:32 +0000 (11:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45941 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/strings/strings.cpp

index e66615565bb6c11b971928f8ce8b7d0942758d99..94d9d7f113158658f0fdf5ab00b9ba72fcab4230 100644 (file)
@@ -186,6 +186,14 @@ void StringTestCase::Extraction()
     CPPUNIT_ASSERT( wxStrcmp( s.substr(3, 5).c_str() , _T("lo, w") ) == 0 );
     CPPUNIT_ASSERT( wxStrcmp( s.substr(3).c_str() , _T("lo, world!") ) == 0 );
 
+#if wxUSE_UNICODE
+    static const char *germanUTF8 = "Oberfl\303\244che";
+    wxString strUnicode(wxString::FromUTF8(germanUTF8));
+
+    CPPUNIT_ASSERT( strUnicode.Mid(0, 10) == strUnicode );
+    CPPUNIT_ASSERT( strUnicode.Mid(7, 2) == "ch" );
+#endif // wxUSE_UNICODE
+
     wxString rest;
 
     #define TEST_STARTS_WITH(prefix, correct_rest, result)                    \