diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-22 12:29:25 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-22 12:50:14 +0000 |
commit | 4a06a42de49215167221177d47cd2eb0e2d59232 (patch) | |
tree | 51049cdbac6d6ad5bebba8e3936424ac40d26d3b /comphelper/qa | |
parent | 5317e0501fe356fb38c7de408cdde1d3f3e1242e (diff) |
want to match here, not check for equality
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 > |