(t *testing.T)
| 598 | } |
| 599 | |
| 600 | func TestGetUnifiedDiffString(t *testing.T) { |
| 601 | A := "one\ntwo\nthree\nfour\nfive\nsix\nseven\neight\nnine\nten\n" |
| 602 | B := "one\ntwo\nthr33\nfour\nfive\nsix\nseven\neight\nnine\nten\n" |
| 603 | // Build diff |
| 604 | diff := LineDiffParams{A: SplitLines(A), |
| 605 | FromFile: "file", FromDate: "then", |
| 606 | B: SplitLines(B), |
| 607 | ToFile: "tile", ToDate: "now", Eol: "", Context: 1} |
| 608 | // Run test |
| 609 | diffStr, err := GetUnifiedDiffString(diff) |
| 610 | if err != nil { |
| 611 | t.Fatal("GetUnifiedDiffString error:", err) |
| 612 | } |
| 613 | exp := "--- file\tthen\n+++ tile\tnow\n@@ -2,3 +2,3 @@\n two\n-three\n+thr33\n four\n" |
| 614 | if diffStr != exp { |
| 615 | t.Fatal("GetUnifiedDiffString failure:", diffStr) |
| 616 | } |
| 617 | } |
nothing calls this directly
no test coverage detected