summaryrefslogtreecommitdiffstats
path: root/modules/indexer/code/bleve_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/indexer/code/bleve_test.go')
-rw-r--r--modules/indexer/code/bleve_test.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/indexer/code/bleve_test.go b/modules/indexer/code/bleve_test.go
index 695dceb259..89cfceea2d 100644
--- a/modules/indexer/code/bleve_test.go
+++ b/modules/indexer/code/bleve_test.go
@@ -49,27 +49,34 @@ func TestIndexAndSearch(t *testing.T) {
keywords = []struct {
Keyword string
IDs []int64
+ Langs int
}{
{
Keyword: "Description",
IDs: []int64{1},
+ Langs: 1,
},
{
Keyword: "repo1",
IDs: []int64{1},
+ Langs: 1,
},
{
Keyword: "non-exist",
IDs: []int64{},
+ Langs: 0,
},
}
)
for _, kw := range keywords {
- total, res, err := idx.Search(nil, kw.Keyword, 1, 10)
+ total, res, langs, err := idx.Search(nil, "", kw.Keyword, 1, 10)
assert.NoError(t, err)
assert.EqualValues(t, len(kw.IDs), total)
+ assert.NotNil(t, langs)
+ assert.Len(t, langs, kw.Langs)
+
var ids = make([]int64, 0, len(res))
for _, hit := range res {
ids = append(ids, hit.RepoID)