Reintroduce ostream support to range formatters (#2014)

This commit is contained in:
Victor Zverovich
2020-11-21 16:31:22 -08:00
parent 38c7def47a
commit a036cc97b7
2 changed files with 10 additions and 2 deletions

View File

@@ -5,7 +5,6 @@
//
// For the license information refer to format.h.
#define FMT_STRING_ALIAS 1
#include "fmt/format.h"
struct test {};
@@ -24,6 +23,7 @@ template <> struct formatter<test> : formatter<int> {
#include <sstream>
#include "fmt/ostream.h"
#include "fmt/ranges.h"
#include "gmock.h"
#include "gtest-extra.h"
#include "util.h"
@@ -324,3 +324,8 @@ TEST(OStreamTest, CompileTimeString) {
TEST(OStreamTest, ToString) {
EXPECT_EQ("ABC", fmt::to_string(fmt_test::ABC()));
}
TEST(OStreamTest, Range) {
auto strs = std::vector<TestString>{TestString("foo"), TestString("bar")};
EXPECT_EQ("{foo, bar}", format("{}", strs));
}