MCPcopy Create free account
hub / github.com/sergi/go-diff / TestDiffCleanupSemantic

Function TestDiffCleanupSemantic

diffmatchpatch/diff_test.go:640–894  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

638}
639
640func 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"},

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
DiffCleanupSemanticMethod · 0.80

Tested by

no test coverage detected