mirror of
https://gitee.com/openharmony/global_i18n
synced 2024-11-26 16:51:24 +00:00
补充接口覆盖测试用例
Signed-off-by: zhangdd_ewan <zhangdongdong50@huawei.com>
This commit is contained in:
parent
527c1a4538
commit
5aec14e653
@ -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;
|
||||
const std::string separator = ",";
|
||||
std::string source = "zh,en,fr,de,zh-Hant,fil";
|
||||
Merge(resultVec, separator, source);
|
||||
EXPECT_EQ(resultVec.size(), 6);
|
||||
|
||||
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