MCPcopy Create free account
hub / github.com/sergi/go-diff / TestPatchMakeOutOfRangePanic

Function TestPatchMakeOutOfRangePanic

diffmatchpatch/patch_test.go:347–370  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

345}
346
347func TestPatchMakeOutOfRangePanic(t *testing.T) {
348 text1 := `
349 1111111111111 000000
350 ------------- ------
351 xxxxxxxxxxxxx ------
352 xxxxxxxxxxxxx ------
353 xxxxxxxxxxxxx xxxxxx
354 xxxxxxxxxxxxx ......
355 xxxxxxxxxxxxx 111111
356 xxxxxxxxxxxxx ??????
357 xxxxxxxxxxxxx 333333
358 xxxxxxxxxxxxx 555555
359 xxxxxxxxxx xxxxx
360 xxxxxxxxxx xxxxx
361 xxxxxxxxxx xxxxx
362 xxxxxxxxxx xxxxx
363`
364 text2 := `
365 2222222222222 000000
366 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
367 dmp := New()
368 patches := dmp.PatchMake(text1, text2)
369 assert.Equal(t, 6, len(patches), "TestPatchMakeOutOfRangePanic")
370}
371
372func TestPatchMakeInvalidUTF8(t *testing.T) {
373 text1 := string([]byte{0xe0})

Callers

nothing calls this directly

Calls 2

NewFunction · 0.85
PatchMakeMethod · 0.80

Tested by

no test coverage detected