(t *testing.T)
| 614 | } |
| 615 | |
| 616 | func TestDiffCleanupSemantic(t *testing.T) { |
| 617 | type TestCase struct { |
| 618 | Name string |
| 619 | |
| 620 | Diffs []Diff |
| 621 | |
| 622 | Expected []Diff |
| 623 | } |
| 624 | |
| 625 | dmp := New() |
| 626 | |
| 627 | for i, tc := range []TestCase{ |
| 628 | { |
| 629 | "Null case", |
| 630 | []Diff{}, |
| 631 | []Diff{}, |
| 632 | }, |
| 633 | { |
| 634 | "No elimination #1", |
| 635 | []Diff{ |
| 636 | {DiffDelete, "ab"}, |
| 637 | {DiffInsert, "cd"}, |
| 638 | {DiffEqual, "12"}, |
| 639 | {DiffDelete, "e"}, |
| 640 | }, |
| 641 | []Diff{ |
| 642 | {DiffDelete, "ab"}, |
| 643 | {DiffInsert, "cd"}, |
| 644 | {DiffEqual, "12"}, |
| 645 | {DiffDelete, "e"}, |
| 646 | }, |
| 647 | }, |
| 648 | { |
| 649 | "No elimination #2", |
| 650 | []Diff{ |
| 651 | {DiffDelete, "abc"}, |
| 652 | {DiffInsert, "ABC"}, |
| 653 | {DiffEqual, "1234"}, |
| 654 | {DiffDelete, "wxyz"}, |
| 655 | }, |
| 656 | []Diff{ |
| 657 | {DiffDelete, "abc"}, |
| 658 | {DiffInsert, "ABC"}, |
| 659 | {DiffEqual, "1234"}, |
| 660 | {DiffDelete, "wxyz"}, |
| 661 | }, |
| 662 | }, |
| 663 | { |
| 664 | "No elimination #3", |
| 665 | []Diff{ |
| 666 | {DiffEqual, "2016-09-01T03:07:1"}, |
| 667 | {DiffInsert, "5.15"}, |
| 668 | {DiffEqual, "4"}, |
| 669 | {DiffDelete, "."}, |
| 670 | {DiffEqual, "80"}, |
| 671 | {DiffInsert, "0"}, |
| 672 | {DiffEqual, "78"}, |
| 673 | {DiffDelete, "3074"}, |
nothing calls this directly
no test coverage detected
searching dependent graphs…