mirror of
https://github.com/fmtlib/fmt.git
synced 2026-08-03 20:14:20 +02:00
Move std::byte formatter to std.h
This commit is contained in:
@@ -75,9 +75,6 @@ TEST(compile_test, format_default) {
|
||||
EXPECT_EQ("foo", fmt::format(FMT_COMPILE("{}"), test_formattable()));
|
||||
auto t = std::chrono::system_clock::now();
|
||||
EXPECT_EQ(fmt::format("{}", t), fmt::format(FMT_COMPILE("{}"), t));
|
||||
# ifdef __cpp_lib_byte
|
||||
EXPECT_EQ("42", fmt::format(FMT_COMPILE("{}"), std::byte{42}));
|
||||
# endif
|
||||
}
|
||||
|
||||
TEST(compile_test, format_escape) {
|
||||
|
||||
@@ -2611,14 +2611,6 @@ TEST(format_test, invalid_glibc_buffer) {
|
||||
}
|
||||
#endif // FMT_USE_FCNTL
|
||||
|
||||
#ifdef __cpp_lib_byte
|
||||
TEST(base_test, format_byte) {
|
||||
auto s = std::string();
|
||||
fmt::format_to(std::back_inserter(s), "{}", std::byte(42));
|
||||
EXPECT_EQ(s, "42");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Only defined after the test case.
|
||||
struct incomplete_type;
|
||||
extern const incomplete_type& external_instance;
|
||||
|
||||
@@ -395,13 +395,6 @@ TEST(ranges_test, join) {
|
||||
EXPECT_EQ(fmt::format("{}", join(v4, " ")), "0 1 0");
|
||||
}
|
||||
|
||||
#ifdef __cpp_lib_byte
|
||||
TEST(ranges_test, join_bytes) {
|
||||
auto v = std::vector<std::byte>{std::byte(1), std::byte(2), std::byte(3)};
|
||||
EXPECT_EQ(fmt::format("{}", fmt::join(v, ", ")), "1, 2, 3");
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST(ranges_test, join_tuple) {
|
||||
// Value tuple args.
|
||||
auto t1 = std::tuple<char, int, float>('a', 1, 2.0f);
|
||||
|
||||
@@ -460,6 +460,14 @@ TEST(std_test, format_bitset) {
|
||||
EXPECT_EQ(fmt::format("{:-^12}", bs), "---101010---");
|
||||
}
|
||||
|
||||
#ifdef __cpp_lib_byte
|
||||
TEST(base_test, format_byte) {
|
||||
auto s = std::string();
|
||||
fmt::format_to(std::back_inserter(s), "{}", std::byte(42));
|
||||
EXPECT_EQ(s, "42");
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST(std_test, format_atomic) {
|
||||
std::atomic<bool> b(false);
|
||||
EXPECT_EQ(fmt::format("{}", b), "false");
|
||||
|
||||
Reference in New Issue
Block a user