diff options
author | Eike Rathke <erack@redhat.com> | 2013-09-19 13:37:56 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-09-19 13:38:32 +0200 |
commit | f86404450621bbee6feaaee0f43f5e53d9501796 (patch) | |
tree | ec627740c449c9f11ca7a5dda16d7a3465ee9c60 /i18nlangtag/qa | |
parent | 5c80c7defccdc8e1a5545dfa0f304c77c71c479d (diff) |
'de-1901' is a valid fallback, 'en-oed' is not
Change-Id: I73b821eaff82796080ce123e37466ec53c327141
Diffstat (limited to 'i18nlangtag/qa')
-rw-r--r-- | i18nlangtag/qa/cppunit/test_languagetag.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/i18nlangtag/qa/cppunit/test_languagetag.cxx b/i18nlangtag/qa/cppunit/test_languagetag.cxx index 079973e38fd6..2368ca23054a 100644 --- a/i18nlangtag/qa/cppunit/test_languagetag.cxx +++ b/i18nlangtag/qa/cppunit/test_languagetag.cxx @@ -319,7 +319,7 @@ void TestLanguageTag::testAllTags() } // 'de-1901' derived from 'de-DE-1901' grandfathered to check that it is - // accepted as (DIGIT 3*ALNUM) variant + // accepted as (DIGIT 3ALNUM) variant { OUString s_de_1901( "de-1901" ); LanguageTag de_1901( s_de_1901 ); @@ -334,6 +334,10 @@ void TestLanguageTag::testAllTags() CPPUNIT_ASSERT( de_1901.isIsoODF() == false ); CPPUNIT_ASSERT( de_1901.getLanguageAndScript() == "de" ); CPPUNIT_ASSERT( de_1901.getVariants() == "1901" ); + ::std::vector< OUString > de_1901_Fallbacks( de_1901.getFallbackStrings( true)); + CPPUNIT_ASSERT( de_1901_Fallbacks.size() == 2); + CPPUNIT_ASSERT( de_1901_Fallbacks[0] == "de-1901"); + CPPUNIT_ASSERT( de_1901_Fallbacks[1] == "de"); } // 'en-GB-oed' is known grandfathered for English, Oxford English @@ -350,6 +354,14 @@ void TestLanguageTag::testAllTags() CPPUNIT_ASSERT( en_GB_oed.isValidBcp47() == true ); CPPUNIT_ASSERT( en_GB_oed.isIsoLocale() == false ); CPPUNIT_ASSERT( en_GB_oed.isIsoODF() == false ); + CPPUNIT_ASSERT( en_GB_oed.getLanguageAndScript() == "en" ); + CPPUNIT_ASSERT( en_GB_oed.getVariants() == "oed" ); + ::std::vector< OUString > en_GB_oed_Fallbacks( en_GB_oed.getFallbackStrings( true)); + CPPUNIT_ASSERT( en_GB_oed_Fallbacks.size() == 3); + CPPUNIT_ASSERT( en_GB_oed_Fallbacks[0] == "en-GB-oed"); + CPPUNIT_ASSERT( en_GB_oed_Fallbacks[1] == "en-GB"); + CPPUNIT_ASSERT( en_GB_oed_Fallbacks[2] == "en"); + // 'en-oed' is not a valid fallback! } // 'qtz' is a local use known pseudolocale for key ID resource |