| 232 | } |
| 233 | |
| 234 | TEST_P(EqualsTest, Recursive) { |
| 235 | const EqualsTestCase& test_case = GetParam(); |
| 236 | cel::Activation activation; |
| 237 | google::protobuf::Arena arena; |
| 238 | cel::RuntimeOptions opts; |
| 239 | opts.unknown_processing = cel::UnknownProcessingOptions::kAttributeOnly; |
| 240 | cel::runtime_internal::RuntimeTypeProvider type_provider( |
| 241 | cel::internal::GetTestingDescriptorPool()); |
| 242 | |
| 243 | auto plan = CreateDirectEqualityStep( |
| 244 | std::make_unique<ValueStep>(MakeValue(test_case.lhs, &arena)), |
| 245 | std::make_unique<ValueStep>(MakeValue(test_case.rhs, &arena)), |
| 246 | test_case.negation, -1); |
| 247 | |
| 248 | ExecutionFrameBase frame(activation, opts, type_provider, |
| 249 | cel::internal::GetTestingDescriptorPool(), |
| 250 | cel::internal::GetTestingMessageFactory(), &arena); |
| 251 | |
| 252 | cel::Value result; |
| 253 | AttributeTrail attribute_trail; |
| 254 | ASSERT_THAT(plan->Evaluate(frame, result, attribute_trail), IsOk()); |
| 255 | |
| 256 | switch (test_case.expected_result) { |
| 257 | case OutputType::kBoolTrue: |
| 258 | EXPECT_THAT(result, BoolValueIs(true)); |
| 259 | break; |
| 260 | case OutputType::kBoolFalse: |
| 261 | EXPECT_THAT(result, BoolValueIs(false)); |
| 262 | break; |
| 263 | case OutputType::kError: |
| 264 | EXPECT_THAT(result, ValueKindIs(ValueKind::kError)); |
| 265 | break; |
| 266 | case OutputType::kUnknown: |
| 267 | EXPECT_THAT(result, ValueKindIs(ValueKind::kUnknown)); |
| 268 | break; |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | TEST_P(EqualsTest, Iterative) { |
| 273 | const EqualsTestCase& test_case = GetParam(); |
nothing calls this directly
no test coverage detected