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

Function TEST_F

eval/eval/container_access_step_test.cc:257–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257TEST_F(ContainerAccessStepTest, TestInvalidReceiverCreateContainerAccessStep) {
258 Expr expr;
259 auto& call = expr.mutable_call_expr();
260 call.set_function(cel::builtin::kIndex);
261 Expr& container_expr = call.mutable_target();
262 container_expr.mutable_ident_expr().set_name("container");
263
264 call.mutable_args().reserve(2);
265 Expr& key_expr = call.mutable_args().emplace_back();
266 key_expr.mutable_ident_expr().set_name("key");
267
268 Expr& extra_arg = call.mutable_args().emplace_back();
269 extra_arg.mutable_const_expr().set_bool_value(true);
270 EXPECT_THAT(CreateContainerAccessStep(call, 0).status(),
271 StatusIs(absl::StatusCode::kInvalidArgument,
272 HasSubstr("Invalid argument count")));
273}
274
275TEST_F(ContainerAccessStepTest, TestInvalidGlobalCreateContainerAccessStep) {
276 Expr expr;

Callers

nothing calls this directly

Calls 13

IsCelInt64Function · 0.85
IsCelErrorFunction · 0.85
IsCelUint64Function · 0.85
set_functionMethod · 0.80
IsInt64Method · 0.80
Int64OrDieMethod · 0.80
IsUnknownSetMethod · 0.80
ErrorOrDieMethod · 0.80
CreateListFunction · 0.50
set_nameMethod · 0.45

Tested by

no test coverage detected