* Add format_to_n overload that accepts FMT_COMPILE * add FormatToNWithCompileMacro test into CompileTest Co-authored-by: Dmitriy Kurkin <Dmitriy.Kurkin@itiviti.com>
This commit is contained in:
co-authored by
Dmitriy Kurkin
parent
5b5a597198
commit
f674434a67
@@ -165,6 +165,14 @@ TEST(CompileTest, FormatTo) {
|
||||
EXPECT_STREQ("42", buf);
|
||||
}
|
||||
|
||||
TEST(CompileTest, FormatToNWithCompileMacro) {
|
||||
constexpr auto buffer_size = 8;
|
||||
char buffer[buffer_size];
|
||||
auto res = fmt::format_to_n(buffer, buffer_size, FMT_COMPILE("{}"), 42);
|
||||
*res.out = '\0';
|
||||
EXPECT_STREQ("42", buffer);
|
||||
}
|
||||
|
||||
TEST(CompileTest, TextAndArg) {
|
||||
EXPECT_EQ(">>>42<<<", fmt::format(FMT_COMPILE(">>>{}<<<"), 42));
|
||||
EXPECT_EQ("42!", fmt::format(FMT_COMPILE("{}!"), 42));
|
||||
|
||||
Reference in New Issue
Block a user