(t *testing.T, x, y string)
| 338 | } |
| 339 | |
| 340 | func testStrings(t *testing.T, x, y string) EditScript { |
| 341 | es := Difference(len(x), len(y), func(ix, iy int) Result { |
| 342 | return compareByte(x[ix], y[iy]) |
| 343 | }) |
| 344 | if es.LenX() != len(x) { |
| 345 | t.Errorf("es.LenX = %d, want %d", es.LenX(), len(x)) |
| 346 | } |
| 347 | if es.LenY() != len(y) { |
| 348 | t.Errorf("es.LenY = %d, want %d", es.LenY(), len(y)) |
| 349 | } |
| 350 | if !validateScript(x, y, es) { |
| 351 | t.Errorf("invalid edit script: %v", es) |
| 352 | } |
| 353 | return es |
| 354 | } |
| 355 | |
| 356 | func validateScript(x, y string, es EditScript) bool { |
| 357 | var bx, by []byte |
no test coverage detected