(t *testing.T)
| 20 | } |
| 21 | |
| 22 | func TestParseHunkHeader(t *testing.T) { |
| 23 | repo := &Repository{} |
| 24 | hunk := &Hunk{ |
| 25 | Text: []string{"@@ -1,5 +2,6 @@ function test"}, |
| 26 | Type: HunkTypeHunk, |
| 27 | } |
| 28 | |
| 29 | err := repo.parseHunkHeader(hunk) |
| 30 | if err != nil { |
| 31 | t.Fatalf("Failed to parse hunk header: %v", err) |
| 32 | } |
| 33 | |
| 34 | if hunk.OldLine != 1 { |
| 35 | t.Errorf("Expected OldLine=1, got %d", hunk.OldLine) |
| 36 | } |
| 37 | if hunk.OldCnt != 5 { |
| 38 | t.Errorf("Expected OldCnt=5, got %d", hunk.OldCnt) |
| 39 | } |
| 40 | if hunk.NewLine != 2 { |
| 41 | t.Errorf("Expected NewLine=2, got %d", hunk.NewLine) |
| 42 | } |
| 43 | if hunk.NewCnt != 6 { |
| 44 | t.Errorf("Expected NewCnt=6, got %d", hunk.NewCnt) |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | func TestParseHunkHeaderSingleLine(t *testing.T) { |
| 49 | repo := &Repository{} |
nothing calls this directly
no test coverage detected