(t *testing.T)
| 638 | } |
| 639 | |
| 640 | func TestDiffCleanupSemantic(t *testing.T) { |
| 641 | type TestCase struct { |
| 642 | Name string |
| 643 | |
| 644 | Diffs []Diff |
| 645 | |
| 646 | Expected []Diff |
| 647 | } |
| 648 | |
| 649 | dmp := New() |
| 650 | |
| 651 | for i, tc := range []TestCase{ |
| 652 | { |
| 653 | "Null case", |
| 654 | []Diff{}, |
| 655 | []Diff{}, |
| 656 | }, |
| 657 | { |
| 658 | "No elimination #1", |
| 659 | []Diff{ |
| 660 | {DiffDelete, "ab"}, |
| 661 | {DiffInsert, "cd"}, |
| 662 | {DiffEqual, "12"}, |
| 663 | {DiffDelete, "e"}, |
| 664 | }, |
| 665 | []Diff{ |
| 666 | {DiffDelete, "ab"}, |
| 667 | {DiffInsert, "cd"}, |
| 668 | {DiffEqual, "12"}, |
| 669 | {DiffDelete, "e"}, |
| 670 | }, |
| 671 | }, |
| 672 | { |
| 673 | "No elimination #2", |
| 674 | []Diff{ |
| 675 | {DiffDelete, "abc"}, |
| 676 | {DiffInsert, "ABC"}, |
| 677 | {DiffEqual, "1234"}, |
| 678 | {DiffDelete, "wxyz"}, |
| 679 | }, |
| 680 | []Diff{ |
| 681 | {DiffDelete, "abc"}, |
| 682 | {DiffInsert, "ABC"}, |
| 683 | {DiffEqual, "1234"}, |
| 684 | {DiffDelete, "wxyz"}, |
| 685 | }, |
| 686 | }, |
| 687 | { |
| 688 | "No elimination #3", |
| 689 | []Diff{ |
| 690 | {DiffEqual, "2016-09-01T03:07:1"}, |
| 691 | {DiffInsert, "5.15"}, |
| 692 | {DiffEqual, "4"}, |
| 693 | {DiffDelete, "."}, |
| 694 | {DiffEqual, "80"}, |
| 695 | {DiffInsert, "0"}, |
| 696 | {DiffEqual, "78"}, |
| 697 | {DiffDelete, "3074"}, |
nothing calls this directly
no test coverage detected