Use correct capacity in iterator_buffer (#1807)

This commit is contained in:
Victor Zverovich
2020-08-08 07:01:21 -07:00
parent d0dd678693
commit 065889a593
2 changed files with 7 additions and 1 deletions

View File

@@ -1946,6 +1946,12 @@ TEST(FormatTest, FormattedSize) {
EXPECT_EQ(2u, fmt::formatted_size("{}", 42));
}
TEST(FormatTest, FormatTo) {
std::vector<char> v;
fmt::format_to(std::back_inserter(v), "{}", "foo");
EXPECT_EQ(string_view(v.data(), v.size()), "foo");
}
TEST(FormatTest, FormatToN) {
char buffer[4];
buffer[3] = 'x';