MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / MatchAndExplain

Method MatchAndExplain

common/value_testing.h:198–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196 {}
197
198 bool MatchAndExplain(const MapValue& arg,
199 testing::MatchResultListener* result_listener) const {
200 std::vector<std::pair<Value, Value>> elements;
201 absl::Status s = arg.ForEach(
202 [&](const Value& key, const Value& value) -> absl::StatusOr<bool> {
203 elements.push_back({key, value});
204 return true;
205 },
206 descriptor_pool_, message_factory_, arena_);
207 if (!s.ok()) {
208 *result_listener << "cannot convert to list of values: " << s;
209 return false;
210 }
211 return m_.MatchAndExplain(elements, result_listener);
212 }
213
214 void DescribeTo(std::ostream* os) const { *os << m_; }
215 void DescribeNegationTo(std::ostream* os) const { *os << m_; }

Callers 1

MatchAndExplainMethod · 0.45

Calls 2

ForEachMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected