| 193 | } |
| 194 | |
| 195 | bool MatchAndExplain(const Res& maybe_value, |
| 196 | testing::MatchResultListener* listener) const override { |
| 197 | if (!maybe_value.status().ok()) { |
| 198 | *listener << "whose error " |
| 199 | << testing::PrintToString(maybe_value.status().ToString()) |
| 200 | << " doesn't match"; |
| 201 | return false; |
| 202 | } |
| 203 | const ValueType& value = maybe_value.ValueOrDie(); |
| 204 | testing::StringMatchResultListener value_listener; |
| 205 | const bool match = value_matcher_.MatchAndExplain(value, &value_listener); |
| 206 | *listener << "whose value " << testing::PrintToString(value) |
| 207 | << (match ? " matches" : " doesn't match"); |
| 208 | testing::internal::PrintIfNotEmpty(value_listener.str(), listener->stream()); |
| 209 | return match; |
| 210 | } |
| 211 | |
| 212 | const testing::Matcher<ValueType> value_matcher_; |
| 213 | }; |
nothing calls this directly
no test coverage detected