Add FMT_COMPILE support to format_to

This commit is contained in:
Victor Zverovich
2020-06-20 15:15:41 -07:00
parent 5ddf9ee1bd
commit 9a4cc88426
2 changed files with 19 additions and 2 deletions
+7
View File
@@ -156,6 +156,13 @@ TEST(CompileTest, FormatDefault) {
EXPECT_EQ("foo", fmt::format(FMT_COMPILE("{}"), std::string("foo")));
}
TEST(CompileTest, FormatTo) {
char buf[8];
auto end = fmt::format_to(buf, FMT_COMPILE("{}"), 42);
*end = '\0';
EXPECT_STREQ("42", buf);
}
TEST(CompileTest, TextAndArg) {
EXPECT_EQ(">>>42<<<", fmt::format(FMT_COMPILE(">>>{}<<<"), 42));
}