| 241 | } |
| 242 | |
| 243 | absl::Status AddTestCaseBindingsToLegacyActivation( |
| 244 | const TestCase& test_case, const CelTestContext& context, |
| 245 | Activation& activation, google::protobuf::Arena* arena) { |
| 246 | auto* message_factory = GetMessageFactory(context); |
| 247 | auto* descriptor_pool = GetDescriptorPool(context); |
| 248 | for (const auto& binding : test_case.input()) { |
| 249 | CEL_ASSIGN_OR_RETURN( |
| 250 | cel::Value resolved_cel_value, |
| 251 | ResolveInputValue(/*input_value=*/binding.second, context, arena)); |
| 252 | CEL_ASSIGN_OR_RETURN(ValueProto value_proto, |
| 253 | ToExprValue(resolved_cel_value, descriptor_pool, |
| 254 | message_factory, arena)); |
| 255 | CEL_ASSIGN_OR_RETURN(LegacyCelValue value, |
| 256 | ValueToCelValue(value_proto, arena)); |
| 257 | activation.InsertValue(/*name=*/binding.first, value); |
| 258 | } |
| 259 | return absl::OkStatus(); |
| 260 | } |
| 261 | |
| 262 | absl::StatusOr<Activation> CreateLegacyActivationFromBindings( |
| 263 | const TestCase& test_case, const CelTestContext& context, |
no test coverage detected