]> git.saurik.com Git - wxWidgets.git/commitdiff
added test for wxString::MakeLower,MakeUpper
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 31 May 2004 22:06:52 +0000 (22:06 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 31 May 2004 22:06:52 +0000 (22:06 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

tests/strings/strings.cpp

index 636ee7e99385f18e5ecc298f3d26fb4b00844d0e..1784339aa3cf41c061a89e60365689b5f2dd92fa 100644 (file)
@@ -45,6 +45,7 @@ private:
         CPPUNIT_TEST( Tokenizer );
         CPPUNIT_TEST( Replace );
         CPPUNIT_TEST( Match );
+        CPPUNIT_TEST( CaseChanges );
     CPPUNIT_TEST_SUITE_END();
 
     void String();
@@ -57,6 +58,7 @@ private:
     void Tokenizer();
     void Replace();
     void Match();
+    void CaseChanges();
 
     DECLARE_NO_COPY_CLASS(StringTestCase)
 };
@@ -271,3 +273,20 @@ void StringTestCase::Match()
     #undef TEST_MATCH
 }
 
+
+void StringTestCase::CaseChanges()
+{
+    wxString s1(_T("Hello!"));
+    wxString s1u(s1);
+    wxString s1l(s1);
+    s1u.MakeUpper();
+    s1l.MakeLower();
+    wxString s2u, s2l;
+    s2u.MakeUpper();
+    s2l.MakeLower();
+
+    CPPUNIT_ASSERT( s1u == _T("HELLO!") );
+    CPPUNIT_ASSERT( s1l == _T("hello!") );
+    CPPUNIT_ASSERT( s2u == wxEmptyString );
+    CPPUNIT_ASSERT( s2l == wxEmptyString );
+}