summaryrefslogtreecommitdiff
path: root/i18npool/qa
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-09-19 09:10:56 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-19 14:38:02 +0100
commit558476135865d9ae7b8801a82c177fd1098386ff (patch)
tree55700e14e26f6875a3b136073ae30df8f351dabc /i18npool/qa
parent6f955b6c7754f3926c33921f0d56d51a95d29c81 (diff)
Related: #112623# add regression test for japanese word break rules
Change-Id: I05baf163cc00d3770b9a8b25b099ffcbd9623a2f
Diffstat (limited to 'i18npool/qa')
-rw-r--r--i18npool/qa/cppunit/test_breakiterator.cxx28
1 files changed, 23 insertions, 5 deletions
diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index aa4e9438c1b0..a6bc2cdbd24f 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -898,14 +898,32 @@ void TestBreakIterator::testJapanese()
lang::Locale aLocale;
aLocale.Language = OUString("ja");
aLocale.Country = OUString("JP");
+ i18n::Boundary aBounds;
- const sal_Unicode JAPANESE[] = { 0x30B7, 0x30E3, 0x30C3, 0x30C8, 0x30C0, 0x30A6, 0x30F3 };
+ {
+ const sal_Unicode JAPANESE[] = { 0x30B7, 0x30E3, 0x30C3, 0x30C8, 0x30C0, 0x30A6, 0x30F3 };
- rtl::OUString aTest(JAPANESE, SAL_N_ELEMENTS(JAPANESE));
- i18n::Boundary aBounds = m_xBreak->getWordBoundary(aTest, 5, aLocale,
- i18n::WordType::DICTIONARY_WORD, true);
+ rtl::OUString aTest(JAPANESE, SAL_N_ELEMENTS(JAPANESE));
+ aBounds = m_xBreak->getWordBoundary(aTest, 5, aLocale,
+ i18n::WordType::DICTIONARY_WORD, true);
- CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 7);
+ CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 7);
+ }
+
+ {
+ const sal_Unicode JAPANESE[] = { 0x9EBB, 0x306E, 0x8449, 0x9EBB, 0x306E, 0x8449 };
+
+ rtl::OUString aTest(JAPANESE, SAL_N_ELEMENTS(JAPANESE));
+ aBounds = m_xBreak->getWordBoundary(aTest, 1, aLocale,
+ i18n::WordType::DICTIONARY_WORD, true);
+
+ CPPUNIT_ASSERT(aBounds.startPos == 0 && aBounds.endPos == 3);
+
+ aBounds = m_xBreak->getWordBoundary(aTest, 5, aLocale,
+ i18n::WordType::DICTIONARY_WORD, true);
+
+ CPPUNIT_ASSERT(aBounds.startPos == 3 && aBounds.endPos == 6);
+ }
}
void TestBreakIterator::setUp()