mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
Cleanup test
This commit is contained in:
@ -93,26 +93,20 @@ TEST(string_view_test, compare) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if FMT_USE_CONSTEVAL
|
#if FMT_USE_CONSTEVAL
|
||||||
namespace {
|
|
||||||
|
|
||||||
template <size_t N> struct fixed_string {
|
template <size_t N> struct fixed_string {
|
||||||
char data[N] = {};
|
char data[N] = {};
|
||||||
|
|
||||||
constexpr fixed_string(const char (&m)[N]) {
|
constexpr fixed_string(const char (&m)[N]) {
|
||||||
for (size_t i = 0; i != N; ++i) {
|
for (size_t i = 0; i != N; ++i) data[i] = m[i];
|
||||||
data[i] = m[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
TEST(string_view_test, from_constexpr_fixed_string) {
|
TEST(string_view_test, from_constexpr_fixed_string) {
|
||||||
static constexpr auto fs = fixed_string<5>("x={}");
|
static constexpr auto fs = fixed_string<4>("foo");
|
||||||
static constexpr auto fmt = fmt::string_view(fs.data);
|
static constexpr auto sv = fmt::string_view(fs.data);
|
||||||
EXPECT_EQ(fmt, "x={}");
|
EXPECT_EQ(sv, "foo");
|
||||||
}
|
}
|
||||||
#endif
|
#endif // FMT_USE_CONSTEVAL
|
||||||
|
|
||||||
TEST(base_test, is_locking) {
|
TEST(base_test, is_locking) {
|
||||||
EXPECT_FALSE(fmt::detail::is_locking<const char(&)[3]>());
|
EXPECT_FALSE(fmt::detail::is_locking<const char(&)[3]>());
|
||||||
|
Reference in New Issue
Block a user