Implement dynamic width in printf.

This commit is contained in:
Victor Zverovich
2014-06-17 06:53:48 -07:00
parent 8666ea82f7
commit 1275923a68
3 changed files with 31 additions and 23 deletions
+1
View File
@@ -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,