| 521 | } |
| 522 | |
| 523 | void PrintDifferences(const ChunkList& original, const ChunkList& modified, |
| 524 | const std::vector<ChunkDiff>& diffs) { |
| 525 | // Utility function to print the original and modified sequences, and the diffs |
| 526 | // between them. Used in case of failing assertions to display the differences. |
| 527 | std::cout << "Original: "; |
| 528 | for (const auto& val : original) { |
| 529 | std::cout << val << " "; |
| 530 | } |
| 531 | std::cout << std::endl; |
| 532 | |
| 533 | std::cout << "Modified: "; |
| 534 | for (const auto& val : modified) { |
| 535 | std::cout << val << " "; |
| 536 | } |
| 537 | std::cout << std::endl; |
| 538 | |
| 539 | for (const auto& diff : diffs) { |
| 540 | std::cout << "First: "; |
| 541 | for (const auto& val : diff.first) { |
| 542 | std::cout << val << " "; |
| 543 | } |
| 544 | std::cout << std::endl; |
| 545 | |
| 546 | std::cout << "Second: "; |
| 547 | for (const auto& val : diff.second) { |
| 548 | std::cout << val << " "; |
| 549 | } |
| 550 | std::cout << std::endl; |
| 551 | } |
| 552 | } |
| 553 | |
| 554 | TEST(TestFindDifferences, Basic) { |
| 555 | ChunkList first = {1, 2, 3, 4, 5}; |
no outgoing calls
no test coverage detected