Skip to content

Commit

Permalink
Fix empty search case
Browse files Browse the repository at this point in the history
Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Apr 18, 2024
1 parent 5314569 commit 3267d02
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/testcases/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/milvus-io/milvus-sdk-go/v2/client"
Expand Down Expand Up @@ -175,7 +176,10 @@ func TestSearchEmptyCollection(t *testing.T) {
common.DefaultTopK,
sp,
)
require.Len(t, searchRes, 0)
require.Len(t, searchRes, common.DefaultNq)
for _, resultSet := range searchRes {
assert.EqualValues(t, 0, resultSet.ResultCount)
}
}
}

Expand Down Expand Up @@ -1151,7 +1155,10 @@ func TestSearchArrayFieldExpr(t *testing.T) {
sp,
)
common.CheckErr(t, errSearchEmpty, true)
require.Empty(t, searchRes)
require.Len(t, searchRes, common.DefaultNq)
for _, resultSet := range searchRes {
assert.EqualValues(t, 0, resultSet.ResultCount)
}
}
}

Expand Down

0 comments on commit 3267d02

Please sign in to comment.