Skip to content

Commit c52de0d

Browse files
committed
Add regression test
1 parent e06e9ca commit c52de0d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/indexer/issues/indexer_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"testing"
99

1010
"code.gitea.io/gitea/models/db"
11+
"code.gitea.io/gitea/models/issues"
1112
"code.gitea.io/gitea/models/unittest"
1213
"code.gitea.io/gitea/modules/indexer/issues/internal"
1314
"code.gitea.io/gitea/modules/optional"
@@ -150,6 +151,11 @@ func searchIssueByID(t *testing.T) {
150151
},
151152
expectedIDs: []int64{6, 1},
152153
},
154+
{
155+
// NOTE: This tests no assignees filtering and also ToSearchOptions() to ensure it will set AssigneeID to 0 when it is passed as -1.
156+
opts: *ToSearchOptions("", &issues.IssuesOptions{AssigneeID: -1}),
157+
expectedIDs: []int64{22, 21, 16, 15, 14, 13, 12, 11, 20, 5, 19, 18, 10, 7, 4, 9, 8, 3, 2},
158+
},
153159
{
154160
opts: SearchOptions{
155161
MentionID: optional.Some(int64(4)),

0 commit comments

Comments
 (0)