mirror of
https://github.com/fmtlib/fmt.git
synced 2026-05-19 23:24:55 +02:00
Specialize formatter for chrono durations
This commit is contained in:
@@ -57,3 +57,10 @@ TEST(TimeTest, GMTime) {
|
||||
std::tm tm = *std::gmtime(&t);
|
||||
EXPECT_TRUE(EqualTime(tm, fmt::gmtime(t)));
|
||||
}
|
||||
|
||||
#if FMT_USE_CHRONO
|
||||
TEST(TimeTest, Chrono) {
|
||||
EXPECT_EQ("42", fmt::format("{:%S}", std::chrono::seconds(42)));
|
||||
EXPECT_EQ("01.234", fmt::format("{:%S}", std::chrono::milliseconds(1234)));
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user