MCPcopy
hub / github.com/expr-lang/expr / TestOmitFilenames

Function TestOmitFilenames

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

Source from the content-addressed store, hash-verified

358}
359
360func TestOmitFilenames(t *testing.T) {
361 diff := UnifiedDiff{
362 A: SplitLines("o\nn\ne\n"),
363 B: SplitLines("t\nw\no\n"),
364 Eol: "\n",
365 }
366 ud, err := GetUnifiedDiffString(diff)
367 assertEqual(t, err, nil)
368 assertEqual(t, SplitLines(ud), []string{
369 "@@ -0,0 +1,2 @@\n",
370 "+t\n",
371 "+w\n",
372 "@@ -2,2 +3,0 @@\n",
373 "-n\n",
374 "-e\n",
375 "\n",
376 })
377
378 cd, err := GetContextDiffString(ContextDiff(diff))
379 assertEqual(t, err, nil)
380 assertEqual(t, SplitLines(cd), []string{
381 "***************\n",
382 "*** 0 ****\n",
383 "--- 1,2 ----\n",
384 "+ t\n",
385 "+ w\n",
386 "***************\n",
387 "*** 2,3 ****\n",
388 "- n\n",
389 "- e\n",
390 "--- 3 ----\n",
391 "\n",
392 })
393}
394
395func TestSplitLines(t *testing.T) {
396 allTests := []struct {

Callers

nothing calls this directly

Calls 5

SplitLinesFunction · 0.85
GetUnifiedDiffStringFunction · 0.85
assertEqualFunction · 0.85
GetContextDiffStringFunction · 0.85
ContextDiffTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…