| 82 | }; |
| 83 | |
| 84 | TEST(RecursiveTest, PartialAttrUnknown) { |
| 85 | cel::Activation activation; |
| 86 | google::protobuf::Arena arena; |
| 87 | cel::RuntimeOptions opts; |
| 88 | opts.unknown_processing = cel::UnknownProcessingOptions::kAttributeOnly; |
| 89 | cel::runtime_internal::RuntimeTypeProvider type_provider( |
| 90 | cel::internal::GetTestingDescriptorPool()); |
| 91 | |
| 92 | // A little contrived for simplicity, but this is for cases where e.g. |
| 93 | // `msg == Msg{}` but msg.foo is unknown. |
| 94 | auto plan = CreateDirectEqualityStep( |
| 95 | std::make_unique<ValueStep>(IntValue(1), cel::Attribute("foo")), |
| 96 | std::make_unique<ValueStep>(IntValue(2)), false, -1); |
| 97 | |
| 98 | activation.SetUnknownPatterns({cel::AttributePattern( |
| 99 | "foo", {cel::AttributeQualifierPattern::OfString("bar")})}); |
| 100 | |
| 101 | ExecutionFrameBase frame(activation, opts, type_provider, |
| 102 | cel::internal::GetTestingDescriptorPool(), |
| 103 | cel::internal::GetTestingMessageFactory(), &arena); |
| 104 | |
| 105 | cel::Value result; |
| 106 | AttributeTrail attribute_trail; |
| 107 | ASSERT_THAT(plan->Evaluate(frame, result, attribute_trail), IsOk()); |
| 108 | |
| 109 | EXPECT_THAT(result, ValueKindIs(ValueKind::kUnknown)); |
| 110 | } |
| 111 | |
| 112 | TEST(RecursiveTest, PartialAttrUnknownDisabled) { |
| 113 | cel::Activation activation; |
nothing calls this directly
no test coverage detected