Fix locale tests on FreeBSD

This commit is contained in:
Victor Zverovich 2024-09-03 12:50:03 -07:00
parent 894b71da85
commit 79e5ae919c
2 changed files with 4 additions and 6 deletions

View File

@ -763,7 +763,7 @@ TEST(chrono_test, weekday) {
EXPECT_EQ(fmt::format("{:%a}", tm), "Sat"); EXPECT_EQ(fmt::format("{:%a}", tm), "Sat");
if (loc != std::locale::classic()) { if (loc != std::locale::classic()) {
auto saturdays = std::vector<std::string>{"sáb", "sá."}; auto saturdays = std::vector<std::string>{"sáb", "sá.", "sáb."};
EXPECT_THAT(saturdays, Contains(fmt::format(loc, "{:L}", sat))); EXPECT_THAT(saturdays, Contains(fmt::format(loc, "{:L}", sat)));
EXPECT_THAT(saturdays, Contains(fmt::format(loc, "{:%a}", sat))); EXPECT_THAT(saturdays, Contains(fmt::format(loc, "{:%a}", sat)));
EXPECT_THAT(saturdays, Contains(fmt::format(loc, "{:%a}", tm))); EXPECT_THAT(saturdays, Contains(fmt::format(loc, "{:%a}", tm)));

View File

@ -567,11 +567,9 @@ TEST(locale_test, chrono_weekday) {
auto sat = fmt::weekday(6); auto sat = fmt::weekday(6);
EXPECT_EQ(fmt::format(L"{}", sat), L"Sat"); EXPECT_EQ(fmt::format(L"{}", sat), L"Sat");
if (loc != std::locale::classic()) { if (loc != std::locale::classic()) {
// L'\xE1' is 'á'. // L'\341' is 'á'.
auto saturdays = std::vector<std::wstring>{ auto saturdays =
L"s\xE1" std::vector<std::wstring>{L"s\341b", L"s\341.", L"s\341b."};
"b",
L"s\xE1."};
EXPECT_THAT(saturdays, Contains(fmt::format(loc, L"{:L}", sat))); EXPECT_THAT(saturdays, Contains(fmt::format(loc, L"{:L}", sat)));
} }
std::locale::global(loc_old); std::locale::global(loc_old);