Use textual formatting for bool with %s specifier in printf (#224)

This commit is contained in:
vitaut
2015-11-13 07:18:44 -08:00
parent 7dcf05108e
commit 2157375d5c
2 changed files with 30 additions and 12 deletions
+5
View File
@@ -373,6 +373,11 @@ TEST(PrintfTest, Length) {
EXPECT_PRINTF(fmt::format("{}", max), "%Lg", max);
}
TEST(PrintfTest, Bool) {
EXPECT_PRINTF("1", "%d", true);
EXPECT_PRINTF("true", "%s", true);
}
TEST(PrintfTest, Int) {
EXPECT_PRINTF("-42", "%d", -42);
EXPECT_PRINTF("-42", "%i", -42);