(t *testing.T)
| 276 | } |
| 277 | |
| 278 | func TestOutputFormatRangeFormatUnified(t *testing.T) { |
| 279 | // Per the diff spec at http://www.unix.org/single_unix_specification/ |
| 280 | // |
| 281 | // Each <range> field shall be of the form: |
| 282 | // %1d", <beginning line number> if the range contains exactly one line, |
| 283 | // and: |
| 284 | // "%1d,%1d", <beginning line number>, <number of lines> otherwise. |
| 285 | // If a range is empty, its beginning line number shall be the number of |
| 286 | // the line just before the range, or 0 if the empty range starts the file. |
| 287 | fm := formatRangeUnified |
| 288 | assertEqual(t, fm(3, 3), "3,0") |
| 289 | assertEqual(t, fm(3, 4), "4") |
| 290 | assertEqual(t, fm(3, 5), "4,2") |
| 291 | assertEqual(t, fm(3, 6), "4,3") |
| 292 | assertEqual(t, fm(0, 0), "0,0") |
| 293 | } |
| 294 | |
| 295 | func TestOutputFormatRangeFormatContext(t *testing.T) { |
| 296 | // Per the diff spec at http://www.unix.org/single_unix_specification/ |
nothing calls this directly
no test coverage detected
searching dependent graphs…