(t *testing.T)
| 1508 | } |
| 1509 | |
| 1510 | func TestDiffPartialLineIndex(t *testing.T) { |
| 1511 | dmp := New() |
| 1512 | t1, t2, tt := dmp.DiffLinesToChars( |
| 1513 | `line 1 |
| 1514 | line 2 |
| 1515 | line 3 |
| 1516 | line 4 |
| 1517 | line 5 |
| 1518 | line 6 |
| 1519 | line 7 |
| 1520 | line 8 |
| 1521 | line 9 |
| 1522 | line 10 text1`, |
| 1523 | `line 1 |
| 1524 | line 2 |
| 1525 | line 3 |
| 1526 | line 4 |
| 1527 | line 5 |
| 1528 | line 6 |
| 1529 | line 7 |
| 1530 | line 8 |
| 1531 | line 9 |
| 1532 | line 10 text2`) |
| 1533 | diffs := dmp.DiffMain(t1, t2, false) |
| 1534 | diffs = dmp.DiffCharsToLines(diffs, tt) |
| 1535 | assert.Equal(t, []Diff{ |
| 1536 | Diff{DiffEqual, "line 1\nline 2\nline 3\nline 4\nline 5\nline 6\nline 7\nline 8\nline 9\n"}, |
| 1537 | Diff{DiffDelete, "line 10 text1"}, |
| 1538 | Diff{DiffInsert, "line 10 text2"}, |
| 1539 | }, diffs) |
| 1540 | } |
| 1541 | |
| 1542 | func BenchmarkDiffMain(bench *testing.B) { |
| 1543 | 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