mirror of
https://gitee.com/openharmony/global_i18n
synced 2024-11-22 22:49:54 +00:00
!900 补充接口覆盖测试用例
Merge pull request !900 from zhangdd_ewan/cherry-241122
This commit is contained in:
commit
06359281ad
@ -49,7 +49,6 @@ bool GetPseudoLocalizationEnforce();
|
||||
std::string PseudoLocalizationProcessor(const std::string &input);
|
||||
std::string PseudoLocalizationProcessor(const std::string &input, bool ifEnforce);
|
||||
bool CheckSystemPermission();
|
||||
size_t ConvertBytesToSizeT(const char *byteArray);
|
||||
std::set<std::string> GetTimeZoneAvailableIDs(I18nErrorCode &errorCode);
|
||||
bool RegexSearchNoExcept(const std::string& str, std::smatch& match, const std::regex& regex);
|
||||
std::string LocaleEncode(const std::string& locale);
|
||||
|
@ -541,6 +541,11 @@ HWTEST_F(IntlTest, IntlFuncTest0062, TestSize.Level1)
|
||||
std::string localeCode = LocaleEncode(localeTag);
|
||||
std::string targetCode = "58400008334651000314";
|
||||
EXPECT_EQ(localeCode, targetCode);
|
||||
std::vector<std::string> resultVec = {"zh", "en", "fr", "de", "zh-Hant", "fil"};
|
||||
const std::string separator = ",";
|
||||
std::string source;
|
||||
Merge(resultVec, separator, source);
|
||||
EXPECT_EQ(source, "zh,en,fr,de,zh-Hant,fil");
|
||||
|
||||
std::string localeRule = "zh-Hans";
|
||||
DateTimeRule* dateTimeRule = new DateTimeRule(localeRule);
|
||||
|
@ -445,6 +445,12 @@ HWTEST_F(LocaleConfigTest, LocaleConfigFuncTest021, TestSize.Level1)
|
||||
flag = LocaleConfig::IsValidTag(fakeTag);
|
||||
EXPECT_TRUE(!flag);
|
||||
EXPECT_FALSE(LocaleConfig::IsValidTag(""));
|
||||
std::string langaugeKey = LocaleConfig::GetLanguageKey();
|
||||
EXPECT_EQ(langaugeKey, "persist.global.language");
|
||||
std::string localeKey = LocaleConfig::GetLocaleKey();
|
||||
EXPECT_EQ(localeKey, "persist.global.locale");
|
||||
std::string hourKey = LocaleConfig::GetHourKey();
|
||||
EXPECT_EQ(hourKey, "persist.global.is24Hour");
|
||||
}
|
||||
} // namespace I18n
|
||||
} // namespace Global
|
||||
|
Loading…
Reference in New Issue
Block a user