make plus flag for printf not be ignored for char argument (#1683)

* make plus flag for printf not be ignored for char argument

* clarify overwriting of alignment specifiers for printf with char argument
This commit is contained in:
rimathia
2020-05-15 15:45:51 +02:00
committed by GitHub
parent 981b517ccf
commit 96c18b26c2
2 changed files with 8 additions and 1 deletions

View File

@@ -156,6 +156,10 @@ TEST(PrintfTest, PlusFlag) {
TEST(PrintfTest, MinusFlag) {
EXPECT_PRINTF("abc ", "%-5s", "abc");
EXPECT_PRINTF("abc ", "%0--5s", "abc");
EXPECT_PRINTF("7 ", "%-5d", 7);
EXPECT_PRINTF("97 ", "%-5hhi", 'a');
EXPECT_PRINTF("a ", "%-5c", 'a');
}
TEST(PrintfTest, SpaceFlag) {