diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-09-19 09:10:56 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-19 14:38:02 +0100 |
commit | 558476135865d9ae7b8801a82c177fd1098386ff (patch) | |
tree | 55700e14e26f6875a3b136073ae30df8f351dabc /i18npool/qa | |
parent | remove duplicated code (diff) | |
download | core-558476135865d9ae7b8801a82c177fd1098386ff.tar.gz core-558476135865d9ae7b8801a82c177fd1098386ff.zip |
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.cxx | 28 |
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() |