MCPcopy Create free account
hub / github.com/apache/arrow / MatchAndExplain

Method MatchAndExplain

cpp/src/arrow/testing/matchers.h:195–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 };

Callers

nothing calls this directly

Calls 6

ValueOrDieMethod · 0.80
strMethod · 0.80
okMethod · 0.45
statusMethod · 0.45
ToStringMethod · 0.45
MatchAndExplainMethod · 0.45

Tested by

no test coverage detected