Format null string as (nil) with p specifier

This commit is contained in:
vitaut
2015-11-12 06:09:08 -08:00
parent 5e37698911
commit 57ba9436a0
2 changed files with 10 additions and 1 deletions
+2
View File
@@ -431,6 +431,8 @@ TEST(PrintfTest, Pointer) {
EXPECT_PRINTF("(nil)", "%p", p);
const char *s = "test";
EXPECT_PRINTF(fmt::format("{:p}", s), "%p", s);
const char *null_str = 0;
EXPECT_PRINTF("(nil)", "%p", null_str);
}
TEST(PrintfTest, Custom) {