From 6caff7ed9ce3d0edee322c7426d1b12f1f2b87c2 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 3 May 2025 08:36:42 -0700 Subject: [PATCH] Cleanup test --- test/base-test.cc | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/test/base-test.cc b/test/base-test.cc index c55c89a0..694f626b 100644 --- a/test/base-test.cc +++ b/test/base-test.cc @@ -93,26 +93,20 @@ TEST(string_view_test, compare) { } #if FMT_USE_CONSTEVAL -namespace { - template struct fixed_string { char data[N] = {}; constexpr fixed_string(const char (&m)[N]) { - for (size_t i = 0; i != N; ++i) { - data[i] = m[i]; - } + for (size_t i = 0; i != N; ++i) data[i] = m[i]; } }; -} // namespace - TEST(string_view_test, from_constexpr_fixed_string) { - static constexpr auto fs = fixed_string<5>("x={}"); - static constexpr auto fmt = fmt::string_view(fs.data); - EXPECT_EQ(fmt, "x={}"); + static constexpr auto fs = fixed_string<4>("foo"); + static constexpr auto sv = fmt::string_view(fs.data); + EXPECT_EQ(sv, "foo"); } -#endif +#endif // FMT_USE_CONSTEVAL TEST(base_test, is_locking) { EXPECT_FALSE(fmt::detail::is_locking());