Implement dynamic width in printf.
This commit is contained in:
1 parent
8666ea82f7
commit
1275923a68
3 files changed
+31
-23
No files matched your search
@@ -135,6 +135,7 @@ TEST(PrintfTest, DefaultAlignRight) {
|
||||
|
||||
TEST(PrintfTest, Width) {
|
||||
EXPECT_PRINTF(" abc", "%5s", "abc");
|
||||
EXPECT_EQ(" 42", str(fmt::sprintf("%*d", 5, 42)));
|
||||
|
||||
// Width cannot be specified twice.
|
||||
EXPECT_THROW_MSG(fmt::sprintf("%5-5d", 42), FormatError,
|
||||
|
||||
Reference in new issue
Block a user