| 145 | : matcher_(std::move(matcher)) {} |
| 146 | |
| 147 | bool MatchAndExplain(const Value& v, |
| 148 | testing::MatchResultListener* listener) const override { |
| 149 | if (!v.IsOptional()) { |
| 150 | *listener << "wanted OptionalValue, got " << ValueKindToString(v.kind()); |
| 151 | return false; |
| 152 | } |
| 153 | const auto& optional_value = v.GetOptional(); |
| 154 | if (!optional_value.HasValue()) { |
| 155 | *listener << "OptionalValue is not engaged"; |
| 156 | return false; |
| 157 | } |
| 158 | return matcher_.MatchAndExplain(optional_value.Value(), listener); |
| 159 | } |
| 160 | |
| 161 | void DescribeTo(std::ostream* os) const override { |
| 162 | *os << "is OptionalValue that is engaged with value whose "; |
nothing calls this directly
no test coverage detected