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

Function TestDiffCleanupSemantic

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

Source from the content-addressed store, hash-verified

614}
615
616func 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"},

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
DiffCleanupSemanticMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…