Skip to content

Commit 130cf54

Browse files
committed
Use a more sensible locale in tests
1 parent 8e0ca05 commit 130cf54

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

test/xchar-test.cc

+6-9
Original file line numberDiff line numberDiff line change
@@ -614,17 +614,14 @@ TEST(locale_test, complex) {
614614
}
615615

616616
TEST(locale_test, chrono_weekday) {
617-
auto loc = get_locale("ru_RU.UTF-8", "Russian_Russia.1251");
617+
auto loc = get_locale("es_ES.UTF-8", "Spanish_Spain.1252");
618618
auto loc_old = std::locale::global(loc);
619-
auto mon = fmt::weekday(1);
620-
EXPECT_EQ(fmt::format(L"{}", mon), L"Mon");
619+
auto sat = fmt::weekday(6);
620+
EXPECT_EQ(fmt::format(L"{}", sat), L"Sat");
621621
if (loc != std::locale::classic()) {
622-
// {L"\x43F\x43D", L"\x41F\x43D", L"\x43F\x43D\x434", L"\x41F\x43D\x434"}
623-
// {L"пн", L"Пн", L"пнд", L"Пнд"}
624-
EXPECT_THAT(
625-
(std::vector<std::wstring>{L"\x43F\x43D", L"\x41F\x43D",
626-
L"\x43F\x43D\x434", L"\x41F\x43D\x434"}),
627-
Contains(fmt::format(loc, L"{:L}", mon)));
622+
// L'\xE1' is 'á'.
623+
auto saturdays = std::vector<std::wstring>{L"s\xE1""b", L"s\xE1."};
624+
EXPECT_THAT(saturdays, Contains(fmt::format(loc, L"{:L}", sat)));
628625
}
629626
std::locale::global(loc_old);
630627
}

0 commit comments

Comments
 (0)