Skip to content

Commit f490963

Browse files
committed
Moving test
1 parent ce781e9 commit f490963

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

test/base-test.cc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,29 @@ TEST(string_view_test, compare) {
9292
check_op<std::greater_equal>();
9393
}
9494

95+
#if FMT_USE_CONSTEVAL
96+
namespace {
97+
98+
template <size_t N>
99+
struct fixed_string {
100+
char data[N] = {};
101+
102+
constexpr fixed_string(char const (&m)[N]) {
103+
for (size_t i = 0; i != N; ++i) {
104+
data[i] = m[i];
105+
}
106+
}
107+
};
108+
109+
}
110+
111+
TEST(string_view_test, from_constexpr_fixed_string) {
112+
static constexpr auto fs = fixed_string<5>("x={}");
113+
static constexpr auto fmt = fmt::string_view(fs.data);
114+
EXPECT_EQ(fmt, "x={}");
115+
}
116+
#endif
117+
95118
TEST(base_test, is_locking) {
96119
EXPECT_FALSE(fmt::detail::is_locking<const char(&)[3]>());
97120
}

test/format-test.cc

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,26 +2563,3 @@ auto fmt::formatter<incomplete_type>::format(const incomplete_type&,
25632563
-> fmt::appender {
25642564
return formatter<int>::format(42, ctx);
25652565
}
2566-
2567-
#if FMT_USE_CONSTEVAL
2568-
namespace {
2569-
2570-
template <size_t N>
2571-
struct fixed_string {
2572-
char data[N] = {};
2573-
2574-
constexpr fixed_string(char const (&m)[N]) {
2575-
for (size_t i = 0; i != N; ++i) {
2576-
data[i] = m[i];
2577-
}
2578-
}
2579-
};
2580-
2581-
}
2582-
2583-
TEST(base_test, from_constexpr_fixed_string) {
2584-
static constexpr auto fs = fixed_string<5>("x={}");
2585-
static constexpr auto fmt = fmt::string_view(fs.data);
2586-
EXPECT_EQ(fmt, "x={}");
2587-
}
2588-
#endif

0 commit comments

Comments
 (0)