mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 01:29:35 +08:00
Support C++20 std::format as an alternative to fmtlib
This commit is contained in:
@@ -8,28 +8,48 @@ void test_pad2(int n, const char *expected)
|
||||
{
|
||||
memory_buf_t buf;
|
||||
spdlog::details::fmt_helper::pad2(n, buf);
|
||||
|
||||
#ifdef SPDLOG_USE_STD_FORMAT
|
||||
REQUIRE(formatted == expected);
|
||||
#else
|
||||
REQUIRE(fmt::to_string(buf) == expected);
|
||||
#endif
|
||||
}
|
||||
|
||||
void test_pad3(uint32_t n, const char *expected)
|
||||
{
|
||||
memory_buf_t buf;
|
||||
spdlog::details::fmt_helper::pad3(n, buf);
|
||||
|
||||
#ifdef SPDLOG_USE_STD_FORMAT
|
||||
REQUIRE(formatted == expected);
|
||||
#else
|
||||
REQUIRE(fmt::to_string(buf) == expected);
|
||||
#endif
|
||||
}
|
||||
|
||||
void test_pad6(std::size_t n, const char *expected)
|
||||
{
|
||||
memory_buf_t buf;
|
||||
spdlog::details::fmt_helper::pad6(n, buf);
|
||||
|
||||
#ifdef SPDLOG_USE_STD_FORMAT
|
||||
REQUIRE(formatted == expected);
|
||||
#else
|
||||
REQUIRE(fmt::to_string(buf) == expected);
|
||||
#endif
|
||||
}
|
||||
|
||||
void test_pad9(std::size_t n, const char *expected)
|
||||
{
|
||||
memory_buf_t buf;
|
||||
spdlog::details::fmt_helper::pad9(n, buf);
|
||||
|
||||
#ifdef SPDLOG_USE_STD_FORMAT
|
||||
REQUIRE(formatted == expected);
|
||||
#else
|
||||
REQUIRE(fmt::to_string(buf) == expected);
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST_CASE("pad2", "[fmt_helper]")
|
||||
|
Reference in New Issue
Block a user