(t *testing.T)
| 111 | } |
| 112 | |
| 113 | func 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 | |
| 135 | var SinkInt int // exported sink var to avoid compiler optimizations in benchmarks |
| 136 |
nothing calls this directly
no test coverage detected