Skip to content

Commit

Permalink
Add a test for #86
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jan 5, 2015
1 parent 6080108 commit cd828a8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/format-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ class Date {
return os;
}

friend std::wostream &operator<<(std::wostream &os, const Date &d) {
os << d.year_ << L'-' << d.month_ << L'-' << d.day_;
return os;
}

template <typename Char>
friend BasicWriter<Char> &operator<<(BasicWriter<Char> &f, const Date &d) {
return f << d.year_ << '-' << d.month_ << '-' << d.day_;
Expand Down Expand Up @@ -1208,6 +1213,7 @@ TEST(FormatterTest, FormatUsingIOStreams) {
EXPECT_EQ("The date is 2012-12-9", s);
Date date(2012, 12, 9);
check_unknown_types(date, "s", "string");
EXPECT_EQ(L"The date is 2012-12-9", format(L"The date is {0}", Date(2012, 12, 9)));
}

class Answer {};
Expand Down

0 comments on commit cd828a8

Please sign in to comment.