Implemented fmt::day, fmt::month, fmt::year and related unit tests (#3906)
This commit is contained in:
@@ -1011,4 +1011,16 @@ TEST(chrono_test, glibc_extensions) {
|
||||
TEST(chrono_test, out_of_range) {
|
||||
auto d = std::chrono::duration<unsigned long, std::giga>(538976288);
|
||||
EXPECT_THROW((void)fmt::format("{:%j}", d), fmt::format_error);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(chrono_test, year_month_day) {
|
||||
auto loc = get_locale("es_ES.UTF-8");
|
||||
std::locale::global(loc);
|
||||
auto year = fmt::year(2024);
|
||||
auto month = fmt::month(1);
|
||||
auto day = fmt::day(1);
|
||||
|
||||
EXPECT_EQ(fmt::format("{}", year), "2024");
|
||||
EXPECT_EQ(fmt::format("{}", month), "Jan");
|
||||
EXPECT_EQ(fmt::format("{}", day), "01");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user