File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
modules/indexer/issues/internal/tests Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import (
15
15
"time"
16
16
17
17
"code.gitea.io/gitea/models/db"
18
+ "code.gitea.io/gitea/modules/indexer/issues"
18
19
"code.gitea.io/gitea/modules/indexer/issues/internal"
19
20
"code.gitea.io/gitea/modules/optional"
20
21
"code.gitea.io/gitea/modules/timeutil"
@@ -77,6 +78,13 @@ func TestIndexer(t *testing.T, indexer internal.Indexer) {
77
78
assert .Equal (t , c .ExpectedIDs , ids )
78
79
assert .Equal (t , c .ExpectedTotal , result .Total )
79
80
}
81
+
82
+ // test counting
83
+ opts := c .SearchOptions .Copy (func (options * issues.SearchOptions ) { options .ListOptions = db.ListOptions {PageSize : 0 } })
84
+ countResult , err := indexer .Search (context .Background (), opts )
85
+ require .NoError (t , err )
86
+ assert .Empty (t , countResult .Hits )
87
+ assert .Equal (t , result .Total , countResult .Total )
80
88
})
81
89
}
82
90
}
You can’t perform that action at this time.
0 commit comments