(t *testing.T)
| 46 | } |
| 47 | |
| 48 | func TestParseHunkHeaderSingleLine(t *testing.T) { |
| 49 | repo := &Repository{} |
| 50 | hunk := &Hunk{ |
| 51 | Text: []string{"@@ -1 +2 @@ function test"}, |
| 52 | Type: HunkTypeHunk, |
| 53 | } |
| 54 | |
| 55 | err := repo.parseHunkHeader(hunk) |
| 56 | if err != nil { |
| 57 | t.Fatalf("Failed to parse hunk header: %v", err) |
| 58 | } |
| 59 | |
| 60 | if hunk.OldLine != 1 { |
| 61 | t.Errorf("Expected OldLine=1, got %d", hunk.OldLine) |
| 62 | } |
| 63 | if hunk.OldCnt != 1 { |
| 64 | t.Errorf("Expected OldCnt=1, got %d", hunk.OldCnt) |
| 65 | } |
| 66 | if hunk.NewLine != 2 { |
| 67 | t.Errorf("Expected NewLine=2, got %d", hunk.NewLine) |
| 68 | } |
| 69 | if hunk.NewCnt != 1 { |
| 70 | t.Errorf("Expected NewCnt=1, got %d", hunk.NewCnt) |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | func TestHunkSplittable(t *testing.T) { |
| 75 | repo := &Repository{} |
nothing calls this directly
no test coverage detected