mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
26f06dd732
Signed-off-by: SimFG <bang.fu@zilliz.com>
32 lines
623 B
Go
32 lines
623 B
Go
package proxy
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/milvus-io/milvus/internal/proto/planpb"
|
|
)
|
|
|
|
func Test_createMilvusReducer(t *testing.T) {
|
|
n := &planpb.PlanNode{
|
|
Node: &planpb.PlanNode_Query{
|
|
Query: &planpb.QueryPlanNode{
|
|
IsCount: false,
|
|
},
|
|
},
|
|
}
|
|
var r milvusReducer
|
|
ctx := context.Background()
|
|
|
|
r = createMilvusReducer(ctx, nil, nil, nil, n, "")
|
|
_, ok := r.(*defaultLimitReducer)
|
|
assert.True(t, ok)
|
|
|
|
n.Node.(*planpb.PlanNode_Query).Query.IsCount = true
|
|
r = createMilvusReducer(ctx, nil, nil, nil, n, "")
|
|
_, ok = r.(*cntReducer)
|
|
assert.True(t, ok)
|
|
}
|