// Copyright (c) 2022-2026 Microsoft Corporation. // Copyright (c) 2026-Present Next Gen C++ Foundation. // Licensed under the MIT License. #include #include #if FMT_VERSION >= 80000 #include #endif // FMT_VERSION >= 80000 #include #include namespace proxy_fmt_format_tests_detail { struct NonFormattable : pro::facade_builder::build {}; static_assert( !std::is_default_constructible_v< fmt::formatter, char>>); static_assert( !std::is_default_constructible_v< fmt::formatter, wchar_t>>); struct Formattable : pro::facade_builder // ::add_skill // ::add_skill // ::build {}; static_assert(std::is_default_constructible_v< fmt::formatter, char>>); static_assert( std::is_default_constructible_v< fmt::formatter, wchar_t>>); } // namespace proxy_fmt_format_tests_detail namespace detail = proxy_fmt_format_tests_detail; TEST(ProxyFmtFormatTests, TestFormat) { int v = 123; pro::proxy p = &v; ASSERT_EQ(fmt::format("{}", *p), "123"); ASSERT_EQ(fmt::format("{:*<6}", *p), "123***"); } TEST(ProxyFmtFormatTests, TestWformat) { int v = 123; pro::proxy p = &v; ASSERT_EQ(fmt::format(L"{}", *p), L"123"); ASSERT_EQ(fmt::format(L"{:*<6}", *p), L"123***"); }