From 79e5ae919c3400ab57cad386ad6336640b1c614d Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 3 Sep 2024 12:50:03 -0700 Subject: [PATCH] Fix locale tests on FreeBSD --- test/chrono-test.cc | 2 +- test/xchar-test.cc | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/chrono-test.cc b/test/chrono-test.cc index ac7cb70a..b62f05d8 100644 --- a/test/chrono-test.cc +++ b/test/chrono-test.cc @@ -763,7 +763,7 @@ TEST(chrono_test, weekday) { EXPECT_EQ(fmt::format("{:%a}", tm), "Sat"); if (loc != std::locale::classic()) { - auto saturdays = std::vector{"sáb", "sá."}; + auto saturdays = std::vector{"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))); diff --git a/test/xchar-test.cc b/test/xchar-test.cc index b31ea6be..d3e5f558 100644 --- a/test/xchar-test.cc +++ b/test/xchar-test.cc @@ -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{ - L"s\xE1" - "b", - L"s\xE1."}; + // L'\341' is 'á'. + auto saturdays = + std::vector{L"s\341b", L"s\341.", L"s\341b."}; EXPECT_THAT(saturdays, Contains(fmt::format(loc, L"{:L}", sat))); } std::locale::global(loc_old);