| 39 | namespace { |
| 40 | |
| 41 | absl::StatusOr<Value> SetsContains( |
| 42 | const ListValue& list, const ListValue& sublist, |
| 43 | const google::protobuf::DescriptorPool* absl_nonnull descriptor_pool, |
| 44 | google::protobuf::MessageFactory* absl_nonnull message_factory, |
| 45 | google::protobuf::Arena* absl_nonnull arena) { |
| 46 | bool any_missing = false; |
| 47 | CEL_RETURN_IF_ERROR(sublist.ForEach( |
| 48 | [&](const Value& sublist_element) -> absl::StatusOr<bool> { |
| 49 | CEL_ASSIGN_OR_RETURN(auto contains, |
| 50 | list.Contains(sublist_element, descriptor_pool, |
| 51 | message_factory, arena)); |
| 52 | |
| 53 | // Treat CEL error as missing |
| 54 | any_missing = |
| 55 | !contains->Is<BoolValue>() || !contains.GetBool().NativeValue(); |
| 56 | // The first false result will terminate the loop. |
| 57 | return !any_missing; |
| 58 | }, |
| 59 | descriptor_pool, message_factory, arena)); |
| 60 | return BoolValue(!any_missing); |
| 61 | } |
| 62 | |
| 63 | absl::StatusOr<Value> SetsIntersects( |
| 64 | const ListValue& list, const ListValue& sublist, |
no test coverage detected