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

Function TestOutputFormatTabDelimiter

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

Source from the content-addressed store, hash-verified

327}
328
329func TestOutputFormatTabDelimiter(t *testing.T) {
330 diff := LineDiffParams{
331 A: splitChars("one"),
332 B: splitChars("two"),
333 FromFile: "Original",
334 FromDate: "2005-01-26 23:30:50",
335 ToFile: "Current",
336 ToDate: "2010-04-12 10:20:52",
337 Eol: "\n",
338 }
339 ud, err := GetUnifiedDiffString(diff)
340 assertEqual(t, err, nil)
341 assertEqual(t, SplitLines(ud)[:2], []string{
342 "--- Original\t2005-01-26 23:30:50\n",
343 "+++ Current\t2010-04-12 10:20:52\n",
344 })
345 cd, err := GetContextDiffString(ContextDiff(diff))
346 assertEqual(t, err, nil)
347 assertEqual(t, SplitLines(cd)[:2], []string{
348 "*** Original\t2005-01-26 23:30:50\n",
349 "--- Current\t2010-04-12 10:20:52\n",
350 })
351}
352
353func TestOutputFormatNoTrailingTabOnEmptyFiledate(t *testing.T) {
354 diff := LineDiffParams{

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected