(t *testing.T)
| 1432 | } |
| 1433 | |
| 1434 | func TestDiffMainWithCheckLines(t *testing.T) { |
| 1435 | type TestCase struct { |
| 1436 | Text1 string |
| 1437 | Text2 string |
| 1438 | } |
| 1439 | |
| 1440 | dmp := New() |
| 1441 | dmp.DiffTimeout = 0 |
| 1442 | |
| 1443 | // Test cases must be at least 100 chars long to pass the cutoff. |
| 1444 | for i, tc := range []TestCase{ |
| 1445 | { |
| 1446 | "1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n", |
| 1447 | "abcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\nabcdefghij\n", |
| 1448 | }, |
| 1449 | { |
| 1450 | "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", |
| 1451 | "abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij", |
| 1452 | }, |
| 1453 | { |
| 1454 | "1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n1234567890\n", |
| 1455 | "abcdefghij\n1234567890\n1234567890\n1234567890\nabcdefghij\n1234567890\n1234567890\n1234567890\nabcdefghij\n1234567890\n1234567890\n1234567890\nabcdefghij\n", |
| 1456 | }, |
| 1457 | } { |
| 1458 | resultWithoutCheckLines := dmp.DiffMain(tc.Text1, tc.Text2, false) |
| 1459 | resultWithCheckLines := dmp.DiffMain(tc.Text1, tc.Text2, true) |
| 1460 | |
| 1461 | // TODO this fails for the third test case, why? |
| 1462 | if i != 2 { |
| 1463 | assert.Equal(t, resultWithoutCheckLines, resultWithCheckLines, fmt.Sprintf("Test case #%d, %#v", i, tc)) |
| 1464 | } |
| 1465 | assert.Equal(t, diffRebuildTexts(resultWithoutCheckLines), diffRebuildTexts(resultWithCheckLines), fmt.Sprintf("Test case #%d, %#v", i, tc)) |
| 1466 | } |
| 1467 | } |
| 1468 | |
| 1469 | func TestMassiveRuneDiffConversion(t *testing.T) { |
| 1470 | sNew, err := ioutil.ReadFile("../testdata/fixture.go") |
nothing calls this directly
no test coverage detected
searching dependent graphs…