(t *testing.T)
| 367 | } |
| 368 | |
| 369 | func 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 | |
| 393 | func TestOutputFormatNoTrailingTabOnEmptyFiledate(t *testing.T) { |
| 394 | diff := UnifiedDiff{ |
nothing calls this directly
no test coverage detected