(t *testing.T)
| 1210 | } |
| 1211 | |
| 1212 | func TestDocument_TranslateRowColToIndex(t *testing.T) { |
| 1213 | d := &Document{ |
| 1214 | Text: "line 1\nline 2\nline 3\nline 4\n", |
| 1215 | cursorPosition: len("line 1\n" + "lin"), |
| 1216 | } |
| 1217 | ac := d.TranslateRowColToIndex(2, 3) |
| 1218 | ex := len("line 1\nline 2\nlin") |
| 1219 | if ac != ex { |
| 1220 | t.Errorf("Should be %#v, got %#v", ex, ac) |
| 1221 | } |
| 1222 | ac = d.TranslateRowColToIndex(0, 0) |
| 1223 | ex = 0 |
| 1224 | if ac != ex { |
| 1225 | t.Errorf("Should be %#v, got %#v", ex, ac) |
| 1226 | } |
| 1227 | } |
| 1228 | |
| 1229 | func TestDocument_OnLastLine(t *testing.T) { |
| 1230 | d := &Document{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…