Added a test for String::upper()

This commit is contained in:
Tsuda Kageyu 2013-10-30 22:40:21 +09:00
parent ced5f262ba
commit 0acdd2379e

View File

@ -43,6 +43,7 @@ class TestString : public CppUnit::TestFixture
CPPUNIT_TEST(testToInt);
CPPUNIT_TEST(testSubstr);
CPPUNIT_TEST(testNewline);
CPPUNIT_TEST(testUpper);
CPPUNIT_TEST_SUITE_END();
public:
@ -237,6 +238,14 @@ public:
CPPUNIT_ASSERT_EQUAL(L'\x0d', String(crlf)[3]);
CPPUNIT_ASSERT_EQUAL(L'\x0a', String(crlf)[4]);
}
void testUpper()
{
String s1 = "tagLIB 012 strING";
String s2 = s1.upper();
CPPUNIT_ASSERT_EQUAL(String("tagLIB 012 strING"), s1);
CPPUNIT_ASSERT_EQUAL(String("TAGLIB 012 STRING"), s2);
}
};