diff --git a/tests/test_pattern_formatter.cpp b/tests/test_pattern_formatter.cpp index edbb84ef..0382b80f 100644 --- a/tests/test_pattern_formatter.cpp +++ b/tests/test_pattern_formatter.cpp @@ -209,6 +209,20 @@ TEST_CASE("clone-default-formatter", "[pattern_formatter]") formatter_1->format(msg, formatted_1); formatter_2->format(msg, formatted_2); + REQUIRE( fmt::to_string(formatted_1) == fmt::to_string(formatted_2)); +} + +TEST_CASE("clone-default-formatter2", "[pattern_formatter]") +{ + auto formatter_1 = std::make_shared("%+"); + auto formatter_2 = formatter_1->clone(); + std::string logger_name = "test"; + spdlog::details::log_msg msg(&logger_name, spdlog::level::info, "some message"); + + fmt::memory_buffer formatted_1; + fmt::memory_buffer formatted_2; + formatter_1->format(msg, formatted_1); + formatter_2->format(msg, formatted_2); REQUIRE( fmt::to_string(formatted_1) == fmt::to_string(formatted_2)); }