| 599 | // Integration Tests |
| 600 | #[test] |
| 601 | fn test_patience_vs_myers_structural() { |
| 602 | // A case where patience should produce better results |
| 603 | let old = lines(&["void foo() {\n", "}\n", "void bar() {\n", "}\n"]); |
| 604 | let new = lines(&[ |
| 605 | "void foo() {\n", |
| 606 | " int x;\n", |
| 607 | "}\n", |
| 608 | "void bar() {\n", |
| 609 | "}\n", |
| 610 | ]); |
| 611 | |
| 612 | let result = diff(&old, &new); |
| 613 | |
| 614 | // Should detect insertion of "int x;" inside foo |
| 615 | assert_eq!(result.insertions(), 1); |
| 616 | assert_eq!(result.deletions(), 0); |
| 617 | } |
| 618 | |
| 619 | #[test] |
| 620 | fn test_fallback_to_myers() { |