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

Function TestOutputFormatTabDelimiter

texteditor/difflib/bytes/bytes_test.go:369–391  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

367}
368
369func TestOutputFormatTabDelimiter(t *testing.T) {
370 diff := UnifiedDiff{
371 A: splitChars("one"),
372 B: splitChars("two"),
373 FromFile: "Original",
374 FromDate: "2005-01-26 23:30:50",
375 ToFile: "Current",
376 ToDate: "2010-04-12 10:20:52",
377 Eol: []byte{'\n'},
378 }
379 ud, err := GetUnifiedDiffString(diff)
380 assertEqual(t, err, nil)
381 assertEqual(t, SplitLines(ud)[:2], stringsToBytes(
382 "--- Original\t2005-01-26 23:30:50\n",
383 "+++ Current\t2010-04-12 10:20:52\n",
384 ))
385 cd, err := GetContextDiffString(ContextDiff(diff))
386 assertEqual(t, err, nil)
387 assertEqual(t, SplitLines(cd)[:2], stringsToBytes(
388 "*** Original\t2005-01-26 23:30:50\n",
389 "--- Current\t2010-04-12 10:20:52\n",
390 ))
391}
392
393func TestOutputFormatNoTrailingTabOnEmptyFiledate(t *testing.T) {
394 diff := UnifiedDiff{

Callers

nothing calls this directly

Calls 7

stringsToBytesFunction · 0.85
ContextDiffTypeAlias · 0.85
splitCharsFunction · 0.70
GetUnifiedDiffStringFunction · 0.70
assertEqualFunction · 0.70
SplitLinesFunction · 0.70
GetContextDiffStringFunction · 0.70

Tested by

no test coverage detected