mirror of
https://github.com/fmtlib/fmt.git
synced 2026-08-03 20:14:20 +02:00
Fix formatting std::tm with null tm_zone (#4790)
This commit is contained in:
@@ -358,6 +358,9 @@ TEST(chrono_test, tm) {
|
||||
char tz[] = "EET";
|
||||
if (fmt::detail::set_tm_zone(time, tz)) {
|
||||
EXPECT_EQ(fmt::format(fmt::runtime("{:%Z}"), time), "EET");
|
||||
fmt::detail::set_tm_zone(time, nullptr);
|
||||
EXPECT_THROW_MSG((void)fmt::format(fmt::runtime("{:%Z}"), time),
|
||||
fmt::format_error, "no timezone");
|
||||
} else {
|
||||
EXPECT_THROW_MSG((void)fmt::format(fmt::runtime("{:%Z}"), time),
|
||||
fmt::format_error, "no timezone");
|
||||
|
||||
Reference in New Issue
Block a user