(t *testing.T)
| 1582 | } |
| 1583 | |
| 1584 | func TestLineToByteOffsets(t *testing.T) { |
| 1585 | src := "\n\n\n" |
| 1586 | want := []int{0, 0, 1, 2, 3} |
| 1587 | if diff := cmp.Diff(want, lineToByteOffsets([]byte(src))); diff != "" { |
| 1588 | t.Error(diff) |
| 1589 | } |
| 1590 | src = "hello" |
| 1591 | want = []int{0, 0} |
| 1592 | if diff := cmp.Diff(want, lineToByteOffsets([]byte(src))); diff != "" { |
| 1593 | t.Error(diff) |
| 1594 | } |
| 1595 | src = "this\nis\na\ntest" |
| 1596 | want = []int{0, 0, 5, 8, 10} |
| 1597 | if diff := cmp.Diff(want, lineToByteOffsets([]byte(src))); diff != "" { |
| 1598 | t.Error(diff) |
| 1599 | } |
| 1600 | } |
| 1601 | |
| 1602 | // |
| 1603 |
nothing calls this directly
no test coverage detected
searching dependent graphs…