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

Function TEST

eval/eval/evaluator_core_test.cc:65–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63};
64
65TEST(EvaluatorCoreTest, ExecutionFrameNext) {
66 ExecutionPath path;
67 google::protobuf::Arena arena;
68 cel::runtime_internal::RuntimeTypeProvider type_provider(
69 cel::internal::GetTestingDescriptorPool());
70 auto const_step = std::make_unique<const FakeConstExpressionStep>();
71 auto incr_step1 = std::make_unique<const FakeIncrementExpressionStep>();
72 auto incr_step2 = std::make_unique<const FakeIncrementExpressionStep>();
73
74 path.push_back(std::move(const_step));
75 path.push_back(std::move(incr_step1));
76 path.push_back(std::move(incr_step2));
77
78 auto dummy_expr = std::make_unique<Expr>();
79
80 cel::RuntimeOptions options;
81 options.unknown_processing = cel::UnknownProcessingOptions::kDisabled;
82 cel::Activation activation;
83 FlatExpressionEvaluatorState state(
84 path.size(),
85 /*comprehension_slots_size=*/0, type_provider,
86 cel::internal::GetTestingDescriptorPool(),
87 cel::internal::GetTestingMessageFactory(), &arena);
88 ExecutionFrame frame(path, activation, options, state);
89
90 EXPECT_THAT(frame.Next(), Eq(path[0].get()));
91 EXPECT_THAT(frame.Next(), Eq(path[1].get()));
92 EXPECT_THAT(frame.Next(), Eq(path[2].get()));
93 EXPECT_THAT(frame.Next(), Eq(nullptr));
94}
95
96TEST(EvaluatorCoreTest, SimpleEvaluatorTest) {
97 ExecutionPath path;

Callers

nothing calls this directly

Calls 15

FlatExpressionClass · 0.85
RegisterBuiltinFunctionsFunction · 0.85
IsInt64Method · 0.80
Int64OrDieMethod · 0.80
set_functionMethod · 0.80
set_iter_varMethod · 0.80
set_accu_varMethod · 0.80
GetRegistryMethod · 0.80
CallMethod · 0.80
sizeMethod · 0.45
NextMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected