Skip to content

Commit 9356dbe

Browse files
committed
fix: remove reduntant test
1 parent d1fc0d7 commit 9356dbe

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

routers/web/repo/compare_test.go

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -38,47 +38,3 @@ func TestAttachCommentsToLines(t *testing.T) {
3838
assert.Equal(t, int64(300), section.Lines[1].Comments[0].ID)
3939
assert.Equal(t, int64(301), section.Lines[1].Comments[1].ID)
4040
}
41-
42-
func TestAttachHiddenCommentIDs(t *testing.T) {
43-
section := &gitdiff.DiffSection{
44-
Lines: []*gitdiff.DiffLine{
45-
{
46-
Type: gitdiff.DiffLineSection,
47-
SectionInfo: &gitdiff.DiffLineSectionInfo{
48-
LastRightIdx: 10,
49-
RightIdx: 20,
50-
RightHunkSize: 5, // Normal expansion
51-
},
52-
},
53-
{
54-
Type: gitdiff.DiffLinePlain,
55-
},
56-
{
57-
Type: gitdiff.DiffLineSection,
58-
SectionInfo: &gitdiff.DiffLineSectionInfo{
59-
LastRightIdx: 30,
60-
RightIdx: 40,
61-
RightHunkSize: 0, // End-of-file expansion
62-
},
63-
},
64-
},
65-
}
66-
67-
lineComments := map[int64][]*issues_model.Comment{
68-
15: {{ID: 100}}, // in first section's hidden range
69-
35: {{ID: 200}}, // in second section's hidden range
70-
40: {{ID: 300}}, // at second section's RightIdx (end-of-file, should be included)
71-
50: {{ID: 400}}, // outside any range
72-
}
73-
74-
attachHiddenCommentIDs(section, lineComments)
75-
76-
// First section: normal expansion, RightIdx is exclusive
77-
assert.Equal(t, []int64{100}, section.Lines[0].SectionInfo.HiddenCommentIDs)
78-
79-
// Second line is not a section
80-
assert.Nil(t, section.Lines[1].SectionInfo)
81-
82-
// Third section: end-of-file expansion, RightIdx is inclusive
83-
assert.ElementsMatch(t, []int64{200, 300}, section.Lines[2].SectionInfo.HiddenCommentIDs)
84-
}

0 commit comments

Comments
 (0)