MCPcopy Create free account
hub / github.com/cogentcore/core / TestOutputFormatRangeFormatUnified

Function TestOutputFormatRangeFormatUnified

texteditor/difflib/difflib_test.go:288–303  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

286}
287
288func TestOutputFormatRangeFormatUnified(t *testing.T) {
289 // Per the diff spec at http://www.unix.org/single_unix_specification/
290 //
291 // Each <range> field shall be of the form:
292 // %1d", <beginning line number> if the range contains exactly one line,
293 // and:
294 // "%1d,%1d", <beginning line number>, <number of lines> otherwise.
295 // If a range is empty, its beginning line number shall be the number of
296 // the line just before the range, or 0 if the empty range starts the file.
297 fm := formatRangeUnified
298 assertEqual(t, fm(3, 3), "3,0")
299 assertEqual(t, fm(3, 4), "4")
300 assertEqual(t, fm(3, 5), "4,2")
301 assertEqual(t, fm(3, 6), "4,3")
302 assertEqual(t, fm(0, 0), "0,0")
303}
304
305func TestOutputFormatRangeFormatContext(t *testing.T) {
306 // Per the diff spec at http://www.unix.org/single_unix_specification/

Callers

nothing calls this directly

Calls 1

assertEqualFunction · 0.70

Tested by

no test coverage detected