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

Function RunExpressionAndGetMessage

eval/eval/create_struct_step_test.cc:145–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145void RunExpressionAndGetMessage(
146 const absl_nonnull std::shared_ptr<const RuntimeEnv>& env,
147 absl::string_view field, const CelValue& value, google::protobuf::Arena* arena,
148 TestMessage* test_msg, bool enable_unknowns,
149 bool enable_recursive_planning) {
150 ASSERT_OK_AND_ASSIGN(auto result,
151 RunExpression(env, field, value, arena, enable_unknowns,
152 enable_recursive_planning));
153 ASSERT_TRUE(result.IsMessage()) << result.DebugString();
154
155 const Message* msg = result.MessageOrDie();
156 ASSERT_THAT(msg, Not(IsNull()));
157
158 ASSERT_EQ(msg->GetDescriptor()->full_name(),
159 "google.api.expr.runtime.TestMessage");
160 test_msg->MergePartialFromString(msg->SerializePartialAsCord());
161}
162
163void RunExpressionAndGetMessage(
164 const absl_nonnull std::shared_ptr<const RuntimeEnv>& env,

Callers 1

TEST_PFunction · 0.85

Calls 5

MessageOrDieMethod · 0.80
CreateListFunction · 0.50
IsMessageMethod · 0.45
DebugStringMethod · 0.45
GetDescriptorMethod · 0.45

Tested by

no test coverage detected