diff --git a/test/compile-test.cc b/test/compile-test.cc index 95960e27..27e39336 100644 --- a/test/compile-test.cc +++ b/test/compile-test.cc @@ -425,10 +425,20 @@ TEST(compile_time_formatting_test, multibyte_fill) { #if FMT_USE_CONSTEXPR_STRING TEST(compile_test, constexpr_format) { - constexpr auto result = []() { - return fmt::format(FMT_COMPILE("{}"), 42) == "42"; - }(); - EXPECT_TRUE(result); + { + constexpr auto result = []() { + return fmt::format(FMT_COMPILE("{}"), 42) == "42"; + }(); + EXPECT_TRUE(result); + } + + { + // Test with a larger string to avoid small string optimization. + constexpr auto result = []() { + return fmt::format(FMT_COMPILE("{:100}"), ' ') == std::string(100, ' '); + }(); + EXPECT_TRUE(result); + } } #endif // FMT_USE_CONSTEXPR_STRING