@ -97,7 +97,7 @@ void Formatter<const char*>::format(Builder& builder, const char* value) const
{
Formatter<std::string_view>::format(
builder,
value != nullptr ? std::string_view { value, strlen(value) } : "(nil)");
value != nullptr ? std::string_view { value, strlen(value) } : "nullptr");
}
// Pointer
@ -149,7 +149,7 @@ struct Formatter<T*> {
void format(Builder& builder, T* value) const
value == nullptr
? builder.putString("0x0")
? builder.putString("nullptr")
: builder.putPointer(static_cast<const void*>(value));
};
@ -26,7 +26,7 @@ TEST_CASE(FormatBasicTypes)
EXPECT_EQ(result, "");
result = Util::format("{}", nullptr);
EXPECT_EQ(result, "(nil)");
EXPECT_EQ(result, "nullptr");
int* number = new int(3);
result = Util::format("{}", number);