| 129 | }; |
| 130 | |
| 131 | absl::StatusOr<std::unique_ptr<ListStorage>> RegisterLegacyLists( |
| 132 | bool overlap, int len, Activation& activation) { |
| 133 | std::vector<CelValue> x; |
| 134 | std::vector<CelValue> y; |
| 135 | x.reserve(len + 1); |
| 136 | y.reserve(len + 1); |
| 137 | if (overlap) { |
| 138 | x.push_back(CelValue::CreateInt64(2)); |
| 139 | y.push_back(CelValue::CreateInt64(1)); |
| 140 | } |
| 141 | |
| 142 | for (int i = 0; i < len; i++) { |
| 143 | x.push_back(CelValue::CreateInt64(1)); |
| 144 | y.push_back(CelValue::CreateInt64(2)); |
| 145 | } |
| 146 | |
| 147 | auto result = std::make_unique<LegacyListStorage>( |
| 148 | ContainerBackedListImpl(std::move(x)), |
| 149 | ContainerBackedListImpl(std::move(y))); |
| 150 | |
| 151 | activation.InsertValue("x", result->x()); |
| 152 | activation.InsertValue("y", result->y()); |
| 153 | return result; |
| 154 | } |
| 155 | |
| 156 | // Constant list literal that has the same elements as the bound test cases. |
| 157 | std::string ConstantList(bool overlap, int len) { |
no test coverage detected