(t *testing.T)
| 1480 | } |
| 1481 | |
| 1482 | func TestDiffPartialLineIndex(t *testing.T) { |
| 1483 | dmp := New() |
| 1484 | t1, t2, tt := dmp.DiffLinesToChars( |
| 1485 | `line 1 |
| 1486 | line 2 |
| 1487 | line 3 |
| 1488 | line 4 |
| 1489 | line 5 |
| 1490 | line 6 |
| 1491 | line 7 |
| 1492 | line 8 |
| 1493 | line 9 |
| 1494 | line 10 text1`, |
| 1495 | `line 1 |
| 1496 | line 2 |
| 1497 | line 3 |
| 1498 | line 4 |
| 1499 | line 5 |
| 1500 | line 6 |
| 1501 | line 7 |
| 1502 | line 8 |
| 1503 | line 9 |
| 1504 | line 10 text2`) |
| 1505 | diffs := dmp.DiffMain(t1, t2, false) |
| 1506 | diffs = dmp.DiffCharsToLines(diffs, tt) |
| 1507 | assert.Equal(t, []Diff{ |
| 1508 | Diff{DiffEqual, "line 1\nline 2\nline 3\nline 4\nline 5\nline 6\nline 7\nline 8\nline 9\n"}, |
| 1509 | Diff{DiffDelete, "line 10 text1"}, |
| 1510 | Diff{DiffInsert, "line 10 text2"}, |
| 1511 | }, diffs) |
| 1512 | } |
| 1513 | |
| 1514 | func BenchmarkDiffMain(bench *testing.B) { |
| 1515 | s1 := "`Twas brillig, and the slithy toves\nDid gyre and gimble in the wabe:\nAll mimsy were the borogoves,\nAnd the mome raths outgrabe.\n" |
nothing calls this directly
no test coverage detected
searching dependent graphs…