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

Function TEST_F

eval/eval/optional_or_step_test.cc:96–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94};
95
96TEST_F(OptionalOrTest, OptionalOrLeftPresentShortcutRight) {
97 RuntimeOptions options;
98 ExecutionFrameBase frame(empty_activation_, options, type_provider_,
99 cel::internal::GetTestingDescriptorPool(),
100 cel::internal::GetTestingMessageFactory(), &arena_);
101
102 std::unique_ptr<DirectExpressionStep> step = CreateDirectOptionalOrStep(
103 /*expr_id=*/-1,
104 CreateConstValueDirectStep(OptionalValue::Of(IntValue(42), &arena_)),
105 MockNeverCalledDirectStep(),
106 /*is_or_value=*/false,
107 /*short_circuiting=*/true);
108
109 Value result;
110 AttributeTrail scratch;
111
112 ASSERT_OK(step->Evaluate(frame, result, scratch));
113
114 EXPECT_THAT(result, OptionalValueIs(IntValueIs(42)));
115}
116
117TEST_F(OptionalOrTest, OptionalOrLeftErrorShortcutsRight) {
118 RuntimeOptions options;

Callers

nothing calls this directly

Calls 12

OfFunction · 0.85
OptionalValueIsFunction · 0.85
IntValueIsFunction · 0.85
ErrorValueFunction · 0.85
MockExpectCallDirectStepFunction · 0.85
ErrorValueIsFunction · 0.85
IntValueClass · 0.50
UnknownValueClass · 0.50
EvaluateMethod · 0.45

Tested by

no test coverage detected