Skip to content

Commit

Permalink
Fix locale tests on FreeBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Sep 3, 2024
1 parent 894b71d commit 79e5ae9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion test/chrono-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ TEST(chrono_test, weekday) {
EXPECT_EQ(fmt::format("{:%a}", tm), "Sat");

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, "{:%a}", sat)));
EXPECT_THAT(saturdays, Contains(fmt::format(loc, "{:%a}", tm)));
Expand Down
8 changes: 3 additions & 5 deletions test/xchar-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -567,11 +567,9 @@ TEST(locale_test, chrono_weekday) {
auto sat = fmt::weekday(6);
EXPECT_EQ(fmt::format(L"{}", sat), L"Sat");
if (loc != std::locale::classic()) {
// L'\xE1' is 'á'.
auto saturdays = std::vector<std::wstring>{
L"s\xE1"
"b",
L"s\xE1."};
// L'\341' is 'á'.
auto saturdays =
std::vector<std::wstring>{L"s\341b", L"s\341.", L"s\341b."};
EXPECT_THAT(saturdays, Contains(fmt::format(loc, L"{:L}", sat)));
}
std::locale::global(loc_old);
Expand Down

0 comments on commit 79e5ae9

Please sign in to comment.