Make format_to work with basic_memory_buffer (#776)

This commit is contained in:
Victor Zverovich
2018-06-23 08:29:26 -07:00
parent 3abd036c47
commit ab2d88ca8e
2 changed files with 15 additions and 7 deletions
+6
View File
@@ -233,6 +233,12 @@ TEST(FormatToTest, FormatToNonbackInsertIteratorWithSignAndNumericAlignment) {
EXPECT_STREQ("+42", buffer);
}
TEST(FormatToTest, FormatToMemoryBuffer) {
fmt::basic_memory_buffer<char, 100> buffer;
fmt::format_to(buffer, "{}", "foo");
EXPECT_EQ("foo", to_string(buffer));
}
TEST(FormatterTest, Escape) {
EXPECT_EQ("{", format("{{"));
EXPECT_EQ("before {", format("before {{"));