| 335 | } |
| 336 | |
| 337 | bool testModifiers() |
| 338 | { |
| 339 | std::cout << "testModifiers()"; |
| 340 | |
| 341 | bool result = true; |
| 342 | |
| 343 | { |
| 344 | cmList list{ "1;2;3;4;5" }; |
| 345 | |
| 346 | auto it = list.insert(list.begin() + 2, "6;7;8"_s); |
| 347 | if (list.size() != 8 || list.to_string() != "1;2;6;7;8;3;4;5") { |
| 348 | result = false; |
| 349 | } |
| 350 | if (*it != "6") { |
| 351 | result = false; |
| 352 | } |
| 353 | } |
| 354 | { |
| 355 | cmList list{ "1;2;3;4;5" }; |
| 356 | |
| 357 | auto it = |
| 358 | list.insert(list.begin() + 2, "6;7;8"_s, cmList::ExpandElements::No); |
| 359 | if (list.size() != 6 || list.to_string() != "1;2;6;7;8;3;4;5") { |
| 360 | result = false; |
| 361 | } |
| 362 | if (*it != "6;7;8") { |
| 363 | result = false; |
| 364 | } |
| 365 | } |
| 366 | { |
| 367 | cmList list{ "1;2;3;4;5" }; |
| 368 | cmList v{ "6", "7", "8" }; |
| 369 | |
| 370 | auto it = list.insert(list.begin() + 2, v); |
| 371 | if (list.size() != 8 || list.to_string() != "1;2;6;7;8;3;4;5") { |
| 372 | result = false; |
| 373 | } |
| 374 | if (*it != "6") { |
| 375 | result = false; |
| 376 | } |
| 377 | } |
| 378 | { |
| 379 | cmList list{ "1;2;3;4;5" }; |
| 380 | cmList v{ "6", "7", "8" }; |
| 381 | |
| 382 | auto it = list.insert(list.begin() + 2, std::move(v)); |
| 383 | if (list.size() != 8 || list.to_string() != "1;2;6;7;8;3;4;5") { |
| 384 | result = false; |
| 385 | } |
| 386 | if (*it != "6") { |
| 387 | result = false; |
| 388 | } |
| 389 | |
| 390 | if (!v.empty()) { |
| 391 | result = false; |
| 392 | } |
| 393 | } |
| 394 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…