aboutsummaryrefslogtreecommitdiff
path: root/absl/strings/str_format_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/strings/str_format_test.cc')
-rw-r--r--absl/strings/str_format_test.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/absl/strings/str_format_test.cc b/absl/strings/str_format_test.cc
index 195ef3fe..3c52be1e 100644
--- a/absl/strings/str_format_test.cc
+++ b/absl/strings/str_format_test.cc
@@ -634,6 +634,10 @@ TEST(StrFormat, BehavesAsDocumented) {
const int& something = *reinterpret_cast<const int*>(ptr_value);
EXPECT_EQ(StrFormat("%p", &something), StrFormat("0x%x", ptr_value));
+ // The output of formatting a null pointer is not documented as being a
+ // specific thing, but the attempt should at least compile.
+ (void)StrFormat("%p", nullptr);
+
// Output widths are supported, with optional flags.
EXPECT_EQ(StrFormat("%3d", 1), " 1");
EXPECT_EQ(StrFormat("%3d", 123456), "123456");