(b *testing.B)
| 420 | } |
| 421 | |
| 422 | func BenchmarkPatchSplitMax(b *testing.B) { |
| 423 | s1, _ := speedtestTexts() |
| 424 | |
| 425 | // Deleting every other character yields one big patch with many small diffs that must be split. |
| 426 | var diffs []Diff |
| 427 | for i := 0; i+1 < len(s1); i += 2 { |
| 428 | diffs = append(diffs, Diff{DiffEqual, s1[i : i+1]}, Diff{DiffDelete, s1[i+1 : i+2]}) |
| 429 | } |
| 430 | |
| 431 | dmp := New() |
| 432 | patches := dmp.PatchMake(s1, diffs) |
| 433 | |
| 434 | b.ResetTimer() |
| 435 | |
| 436 | for i := 0; i < b.N; i++ { |
| 437 | b.StopTimer() |
| 438 | p := dmp.PatchDeepCopy(patches) |
| 439 | b.StartTimer() |
| 440 | dmp.PatchSplitMax(p) |
| 441 | } |
| 442 | } |
nothing calls this directly
no test coverage detected