Make precision and alignment work together.

This commit is contained in:
Victor Zverovich
2014-06-21 08:18:05 -07:00
parent f430516d3f
commit 6238f2daa1
2 changed files with 20 additions and 10 deletions

View File

@@ -241,7 +241,11 @@ TEST(PrintfTest, Precision) {
EXPECT_PRINTF(" 00042", "%7.5o", 042);
EXPECT_PRINTF(" 00042", "%#10.5o", 042);
// TODO: test left alignment
EXPECT_PRINTF("00042 ", "%-7.5d", 42);
EXPECT_PRINTF("00042 ", "%-7.5x", 0x42);
EXPECT_PRINTF("0x00042 ", "%-#10.5x", 0x42);
EXPECT_PRINTF("00042 ", "%-7.5o", 042);
EXPECT_PRINTF("00042 ", "%-#10.5o", 042);
}
// TODO: test length and type specifier