()
| 630 | |
| 631 | #[test] |
| 632 | fn test_complex_reordering() { |
| 633 | let old = lines(&["first\n", "second\n", "third\n", "fourth\n", "fifth\n"]); |
| 634 | let new = lines(&["first\n", "third\n", "inserted\n", "fourth\n", "fifth\n"]); |
| 635 | |
| 636 | let result = diff(&old, &new); |
| 637 | |
| 638 | // second deleted, inserted added |
| 639 | assert_eq!(result.deletions(), 1); |
| 640 | assert_eq!(result.insertions(), 1); |
| 641 | } |
| 642 | |
| 643 | #[test] |
| 644 | fn test_preserves_order() { |