| 293 | void DescribeNegationTo(::std::ostream* os) const override { *os << "is not ok"; } |
| 294 | |
| 295 | bool MatchAndExplain(const Res& maybe_value, |
| 296 | testing::MatchResultListener* listener) const override { |
| 297 | const Status& status = ToStatus(maybe_value); |
| 298 | |
| 299 | const bool match = status.ok(); |
| 300 | *listener << "whose " << (match ? "non-error matches" : "error doesn't match"); |
| 301 | return match; |
| 302 | } |
| 303 | }; |
| 304 | |
| 305 | return testing::Matcher<Res>(new Impl()); |