(b *testing.B)
| 405 | } |
| 406 | |
| 407 | func BenchmarkPatchApply(b *testing.B) { |
| 408 | s1, s2 := speedtestTexts() |
| 409 | |
| 410 | dmp := New() |
| 411 | patches := dmp.PatchMake(s1, s2) |
| 412 | // Shift the text so patches miss their expected location and fall back to fuzzy matching. |
| 413 | text := strings.Repeat("x", 16) + s1 |
| 414 | |
| 415 | b.ResetTimer() |
| 416 | |
| 417 | for i := 0; i < b.N; i++ { |
| 418 | dmp.PatchApply(patches, text) |
| 419 | } |
| 420 | } |
| 421 | |
| 422 | func BenchmarkPatchSplitMax(b *testing.B) { |
| 423 | s1, _ := speedtestTexts() |
nothing calls this directly
no test coverage detected