summaryrefslogtreecommitdiff
path: root/i18npool/qa
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-07-25 11:37:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-07-25 11:37:58 +0100
commit071a0dc02c90e939a23f99af1f9c4c65982bdd7d (patch)
treee9162edee1e4543a9afe1b226175ffa6db86d32b /i18npool/qa
parent4f1e5b34211a714baad8a05ab38f3f953ebd4cce (diff)
Related: #i85411# catalan word breaking rules out of sync with ZWNJ
I can see no reason to have specific catalan rules, old examples work fine with default rules Change-Id: Ifacb7b46204d8aed543ab0c77fe80d1d5c5de738
Diffstat (limited to 'i18npool/qa')
-rw-r--r--i18npool/qa/cppunit/test_breakiterator.cxx38
1 files changed, 38 insertions, 0 deletions
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index 403c71bdbf3a..b04dc531ebec 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -397,6 +397,44 @@ void TestBreakIterator::testWordBoundaries()
while (nPos++ < aTest.getLength());
CPPUNIT_ASSERT(i == SAL_N_ELEMENTS(aExpected));
}
+
+ //See https://issues.apache.org/ooo/show_bug.cgi?id=85411
+ for (int j = 0; j < 2; ++j)
+ {
+ switch (j)
+ {
+ case 0:
+ aLocale.Language = rtl::OUString("en");
+ aLocale.Country = rtl::OUString("US");
+ break;
+ case 1:
+ aLocale.Language = rtl::OUString("ca");
+ aLocale.Country = rtl::OUString("ES");
+ break;
+ default:
+ CPPUNIT_ASSERT(false);
+ break;
+ }
+
+ const sal_Unicode TEST[] =
+ {
+ 'I', 0x200B, 'w', 'a', 'n', 't', 0x200B, 't', 'o', 0x200B, 'g', 'o'
+ };
+ rtl::OUString aTest(TEST, SAL_N_ELEMENTS(TEST));
+
+ sal_Int32 nPos = 0;
+ sal_Int32 aExpected[] = {1, 6, 9, 12};
+ size_t i = 0;
+ do
+ {
+ CPPUNIT_ASSERT(i < SAL_N_ELEMENTS(aExpected));
+ nPos = m_xBreak->getWordBoundary(aTest, nPos, aLocale,
+ i18n::WordType::DICTIONARY_WORD, true).endPos;
+ CPPUNIT_ASSERT(aExpected[i++] == nPos);
+ }
+ while (nPos++ < aTest.getLength());
+ CPPUNIT_ASSERT(i == SAL_N_ELEMENTS(aExpected));
+ }
}
//See http://qa.openoffice.org/issues/show_bug.cgi?id=111152