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

Function TEST

runtime/standard_runtime_builder_factory_test.cc:81–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81TEST(StandardRuntimeTest, RecursionLimitExceeded) {
82 RuntimeOptions opts;
83 opts.max_recursion_depth = 1;
84
85 ASSERT_OK_AND_ASSIGN(auto builder,
86 CreateStandardRuntimeBuilder(
87 google::protobuf::DescriptorPool::generated_pool(), opts));
88
89 ASSERT_OK_AND_ASSIGN(auto runtime, std::move(builder).Build());
90
91 ASSERT_OK_AND_ASSIGN(ParsedExpr expr, ParseWithTestMacros("1 + 2"));
92
93 EXPECT_THAT(ProtobufRuntimeAdapter::CreateProgram(*runtime, expr),
94 StatusIs(absl::StatusCode::kInvalidArgument,
95 HasSubstr("Maximum recursion depth of 1 exceeded")));
96}
97
98TEST(StandardRuntimeTest, RecursionUnderLimit) {
99 RuntimeOptions opts;

Callers

nothing calls this directly

Calls 9

CreateProgramFunction · 0.85
TestOnly_IsRecursiveImplFunction · 0.85
IntValueIsFunction · 0.85
error_codeMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70
getMethod · 0.45
severityMethod · 0.45
NativeValueMethod · 0.45
GetBoolMethod · 0.45

Tested by

no test coverage detected