More iterator support & fmt::count

This commit is contained in:
Victor Zverovich
2018-01-17 22:04:24 -08:00
parent e3b69efbe1
commit 64b349aee2
3 changed files with 60 additions and 15 deletions
+5 -1
View File
@@ -1910,7 +1910,7 @@ TEST(FormatTest, ToString) {
EXPECT_EQ("42", fmt::to_string(42));
}
TEST(WriterTest, OutputIterators) {
TEST(FormatTest, OutputIterators) {
std::list<char> out;
fmt::format_to(std::back_inserter(out), "{}", 42);
EXPECT_EQ("42", std::string(out.begin(), out.end()));
@@ -1918,3 +1918,7 @@ TEST(WriterTest, OutputIterators) {
fmt::format_to(std::ostream_iterator<char>(s), "{}", 42);
EXPECT_EQ("42", s.str());
}
TEST(FormatTest, OutputSize) {
EXPECT_EQ(2, fmt::count("{}", 42));
}