mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Add String:rfind
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@961188 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
@ -33,6 +33,7 @@ class TestString : public CppUnit::TestFixture
|
||||
{
|
||||
CPPUNIT_TEST_SUITE(TestString);
|
||||
CPPUNIT_TEST(testString);
|
||||
CPPUNIT_TEST(testRfind);
|
||||
CPPUNIT_TEST(testUTF16Encode);
|
||||
CPPUNIT_TEST(testUTF16Decode);
|
||||
CPPUNIT_TEST(testUTF16DecodeInvalidBOM);
|
||||
@ -151,6 +152,19 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(String("a"), b);
|
||||
}
|
||||
|
||||
void testRfind()
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL(-1, String("foo.bar").rfind(".", 0));
|
||||
CPPUNIT_ASSERT_EQUAL(-1, String("foo.bar").rfind(".", 1));
|
||||
CPPUNIT_ASSERT_EQUAL(-1, String("foo.bar").rfind(".", 2));
|
||||
CPPUNIT_ASSERT_EQUAL(3, String("foo.bar").rfind(".", 3));
|
||||
CPPUNIT_ASSERT_EQUAL(3, String("foo.bar").rfind(".", 4));
|
||||
CPPUNIT_ASSERT_EQUAL(3, String("foo.bar").rfind(".", 5));
|
||||
CPPUNIT_ASSERT_EQUAL(3, String("foo.bar").rfind(".", 6));
|
||||
CPPUNIT_ASSERT_EQUAL(3, String("foo.bar").rfind(".", 7));
|
||||
CPPUNIT_ASSERT_EQUAL(3, String("foo.bar").rfind("."));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestString);
|
||||
|
Reference in New Issue
Block a user