| 94 | }; |
| 95 | |
| 96 | TEST_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 | |
| 117 | TEST_F(OptionalOrTest, OptionalOrLeftErrorShortcutsRight) { |
| 118 | RuntimeOptions options; |
nothing calls this directly
no test coverage detected