Fix handling of width when formatting int as char
This commit is contained in:
+3
-2
@@ -868,8 +868,9 @@ TEST(FormatterTest, Width) {
|
||||
EXPECT_EQ(" 0xcafe", format("{0:10}", reinterpret_cast<void*>(0xcafe)));
|
||||
EXPECT_EQ("x ", format("{0:11}", 'x'));
|
||||
EXPECT_EQ("str ", format("{0:12}", "str"));
|
||||
EXPECT_EQ(fmt::format("{:*^5}", "🤡"), "**🤡**");
|
||||
EXPECT_EQ(fmt::format("{:#6}", 42.0), " 42.0");
|
||||
EXPECT_EQ(format("{:*^5}", "🤡"), "**🤡**");
|
||||
EXPECT_EQ(format("{:#6}", 42.0), " 42.0");
|
||||
EXPECT_EQ(format("{:6c}", static_cast<int>('x')), "x ");
|
||||
}
|
||||
|
||||
template <typename T> inline T const_check(T value) { return value; }
|
||||
|
||||
Reference in New Issue
Block a user