diff options
Diffstat (limited to 'comphelper/qa')
-rw-r--r-- | comphelper/qa/string/test_string.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/comphelper/qa/string/test_string.cxx b/comphelper/qa/string/test_string.cxx index 110638164506..2ce6f2cff1bb 100644 --- a/comphelper/qa/string/test_string.cxx +++ b/comphelper/qa/string/test_string.cxx @@ -55,6 +55,7 @@ public: void testIsalnumAsciiString(); void testIsupperAsciiString(); void testIndexOfL(); + void testMatchIgnoreAsciiCaseL(); CPPUNIT_TEST_SUITE(TestString); CPPUNIT_TEST(testSearchAndReplaceAsciiL); @@ -67,6 +68,7 @@ public: CPPUNIT_TEST(testIsalnumAsciiString); CPPUNIT_TEST(testIsupperAsciiString); CPPUNIT_TEST(testIndexOfL); + CPPUNIT_TEST(testMatchIgnoreAsciiCaseL); CPPUNIT_TEST_SUITE_END(); }; @@ -168,6 +170,23 @@ void TestString::testIndexOfL() RTL_CONSTASCII_STRINGPARAM("two"), 5), static_cast<sal_Int32>(-1)); } +void TestString::testMatchIgnoreAsciiCaseL() +{ + rtl::OString s1(RTL_CONSTASCII_STRINGPARAM("one two three")); + + CPPUNIT_ASSERT_EQUAL(comphelper::string::matchIgnoreAsciiCaseL(s1, + RTL_CONSTASCII_STRINGPARAM("one")), sal_True); + + CPPUNIT_ASSERT_EQUAL(comphelper::string::matchIgnoreAsciiCaseL(s1, + RTL_CONSTASCII_STRINGPARAM("ONE")), sal_True); + + CPPUNIT_ASSERT_EQUAL(comphelper::string::matchIgnoreAsciiCaseL(s1, + RTL_CONSTASCII_STRINGPARAM("two")), sal_False); + + CPPUNIT_ASSERT_EQUAL(comphelper::string::matchIgnoreAsciiCaseL(s1, + RTL_CONSTASCII_STRINGPARAM("two"), 4), sal_True); +} + using namespace ::com::sun::star; class testCollator : public cppu::WeakImplHelper1< i18n::XCollator > |