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

Function TEST_F

eval/eval/lazy_init_step_test.cc:61–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59};
60
61TEST_F(LazyInitStepTest, CreateCheckInitStepDoesInit) {
62 ExecutionPath path;
63 ExecutionPath subpath;
64
65 path.push_back(CreateLazyInitStep(/*slot_index=*/0,
66 /*subexpression_index=*/1, -1));
67
68 ASSERT_OK_AND_ASSIGN(subpath.emplace_back(),
69 CreateConstValueStep(cel::IntValue(42), -1, false));
70
71 std::vector<ExecutionPathView> expression_table{path, subpath};
72
73 ExecutionFrame frame(expression_table, activation_, runtime_options_,
74 evaluator_state_);
75 ASSERT_OK_AND_ASSIGN(auto value, frame.Evaluate());
76
77 EXPECT_TRUE(value->Is<IntValue>() && value.GetInt().NativeValue() == 42);
78}
79
80TEST_F(LazyInitStepTest, CreateCheckInitStepSkipInit) {
81 ExecutionPath path;

Callers

nothing calls this directly

Calls 15

CreateLazyInitStepFunction · 0.85
CreateConstValueStepFunction · 0.85
CreateClearSlotStepFunction · 0.85
CreateClearSlotsStepFunction · 0.85
ClearSlotMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.50
IntValueClass · 0.50
NativeValueMethod · 0.45
GetIntMethod · 0.45
SetMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected