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

Function TestOutputFormatRangeFormatContext

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

Source from the content-addressed store, hash-verified

293}
294
295func TestOutputFormatRangeFormatContext(t *testing.T) {
296 // Per the diff spec at http://www.unix.org/single_unix_specification/
297 //
298 // The range of lines in file1 shall be written in the following format
299 // if the range contains two or more lines:
300 // "*** %d,%d ****\n", <beginning line number>, <ending line number>
301 // and the following format otherwise:
302 // "*** %d ****\n", <ending line number>
303 // The ending line number of an empty range shall be the number of the preceding line,
304 // or 0 if the range is at the start of the file.
305 //
306 // Next, the range of lines in file2 shall be written in the following format
307 // if the range contains two or more lines:
308 // "--- %d,%d ----\n", <beginning line number>, <ending line number>
309 // and the following format otherwise:
310 // "--- %d ----\n", <ending line number>
311 fm := formatRangeContext
312 assertEqual(t, fm(3, 3), "3")
313 assertEqual(t, fm(3, 4), "4")
314 assertEqual(t, fm(3, 5), "4,5")
315 assertEqual(t, fm(3, 6), "4,6")
316 assertEqual(t, fm(0, 0), "0")
317}
318
319func TestOutputFormatTabDelimiter(t *testing.T) {
320 diff := UnifiedDiff{

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…