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

Function TestDiffCommonSuffix

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

Source from the content-addressed store, hash-verified

111}
112
113func TestDiffCommonSuffix(t *testing.T) {
114 type TestCase struct {
115 Name string
116
117 Text1 string
118 Text2 string
119
120 Expected int
121 }
122
123 dmp := New()
124
125 for i, tc := range []TestCase{
126 {"Null", "abc", "xyz", 0},
127 {"Non-null", "abcdef1234", "xyz1234", 4},
128 {"Whole", "1234", "xyz1234", 4},
129 } {
130 actual := dmp.DiffCommonSuffix(tc.Text1, tc.Text2)
131 assert.Equal(t, tc.Expected, actual, fmt.Sprintf("Test case #%d, %s", i, tc.Name))
132 }
133}
134
135var SinkInt int // exported sink var to avoid compiler optimizations in benchmarks
136

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
DiffCommonSuffixMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…