| 343 | : src_matcher_(std::move(src_matcher)), src_oidx_(src_oidx) {} |
| 344 | |
| 345 | bool MatchAndExplain( |
| 346 | OutEdge out_edge, |
| 347 | ::testing::MatchResultListener* listener) const override { |
| 348 | ::testing::StringMatchResultListener inner_listener; |
| 349 | if (!src_matcher_.MatchAndExplain(out_edge.first, &inner_listener)) { |
| 350 | if (listener->IsInterested()) { |
| 351 | *listener << "\nsource does not match expected "; |
| 352 | src_matcher_.DescribeTo(listener->stream()); |
| 353 | string explanation = inner_listener.str(); |
| 354 | if (!explanation.empty()) { |
| 355 | *listener << "\n\t" << explanation; |
| 356 | } |
| 357 | } |
| 358 | return false; |
| 359 | } |
| 360 | if (out_edge.second != src_oidx_) { |
| 361 | if (listener->IsInterested()) { |
| 362 | *listener << "\nexpected output slot to be " << src_oidx_ |
| 363 | << " but found " << out_edge.second; |
| 364 | } |
| 365 | return false; |
| 366 | } |
| 367 | |
| 368 | return true; |
| 369 | } |
| 370 | |
| 371 | void DescribeTo(::std::ostream* os) const override { |
| 372 | if (src_oidx_) { |
nothing calls this directly
no test coverage detected