Implement dynamic precision in printf.

This commit is contained in:
Victor Zverovich
2014-06-23 07:16:46 -07:00
parent 0552f5b809
commit 1a75ed01cd
2 changed files with 27 additions and 54 deletions
+5
View File
@@ -263,6 +263,11 @@ TEST(PrintfTest, IgnorePrecisionForNonNumericArg) {
EXPECT_PRINTF("abc", "%.5s", "abc");
}
TEST(PrintfTest, DynamicPrecision) {
EXPECT_EQ("00042", str(fmt::sprintf("%.*d", 5, 42)));
// TODO: more tests
}
// TODO: test length and type specifier
#endif