MCPcopy Index your code
hub / github.com/expr-lang/expr / TestOutputFormatRangeFormatUnified

Function TestOutputFormatRangeFormatUnified

internal/difflib/difflib_test.go:278–293  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

276}
277
278func 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
295func TestOutputFormatRangeFormatContext(t *testing.T) {
296 // Per the diff spec at http://www.unix.org/single_unix_specification/

Callers

nothing calls this directly

Calls 1

assertEqualFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…