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

Method MatchAndExplain

common/value_testing.cc:147–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

ValueKindToStringFunction · 0.85
HasValueMethod · 0.80
IsOptionalMethod · 0.45
kindMethod · 0.45
GetOptionalMethod · 0.45
MatchAndExplainMethod · 0.45
ValueMethod · 0.45

Tested by

no test coverage detected