(t *testing.T)
| 179 | } |
| 180 | |
| 181 | func TestCommonSuffixLength(t *testing.T) { |
| 182 | type TestCase struct { |
| 183 | Text1 string |
| 184 | Text2 string |
| 185 | |
| 186 | Expected int |
| 187 | } |
| 188 | |
| 189 | for i, tc := range []TestCase{ |
| 190 | {"abc", "xyz", 0}, |
| 191 | {"abcdef1234", "xyz1234", 4}, |
| 192 | {"1234", "xyz1234", 4}, |
| 193 | {"123", "a3", 1}, |
| 194 | } { |
| 195 | actual := commonSuffixLength([]rune(tc.Text1), []rune(tc.Text2)) |
| 196 | assert.Equal(t, tc.Expected, actual, fmt.Sprintf("Test case #%d, %#v", i, tc)) |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | func TestDiffCommonOverlap(t *testing.T) { |
| 201 | type TestCase struct { |
nothing calls this directly
no test coverage detected