Fix handling of dynamic width in chrono formatter

Thanks to Howard Hinnant.
This commit is contained in:
Victor Zverovich
2019-01-09 15:23:21 -08:00
parent f5cc77cea0
commit dc8f8ce4c0
2 changed files with 9 additions and 4 deletions
+2
View File
@@ -103,6 +103,8 @@ TEST(ChronoTest, Align) {
fmt::format("{:>12%H:%M:%S}", std::chrono::seconds(12345)));
EXPECT_EQ("~~03:25:45~~",
fmt::format("{:~^12%H:%M:%S}", std::chrono::seconds(12345)));
EXPECT_EQ("03:25:45 ",
fmt::format("{:{}%H:%M:%S}", std::chrono::seconds(12345), 12));
}