mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 04:49:08 +08:00
1f43be4a3c
issue: #29309 reopen pr : #29310 Signed-off-by: Cai Zhang <cai.zhang@zilliz.com>
26 lines
806 B
Go
26 lines
806 B
Go
package indexparamcheck
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/v2/schemapb"
|
|
)
|
|
|
|
func Test_INVERTEDIndexChecker(t *testing.T) {
|
|
c := newINVERTEDChecker()
|
|
|
|
assert.NoError(t, c.CheckTrain(map[string]string{}))
|
|
|
|
assert.NoError(t, c.CheckValidDataType(schemapb.DataType_VarChar))
|
|
assert.NoError(t, c.CheckValidDataType(schemapb.DataType_String))
|
|
assert.NoError(t, c.CheckValidDataType(schemapb.DataType_Bool))
|
|
assert.NoError(t, c.CheckValidDataType(schemapb.DataType_Int64))
|
|
assert.NoError(t, c.CheckValidDataType(schemapb.DataType_Float))
|
|
|
|
assert.Error(t, c.CheckValidDataType(schemapb.DataType_JSON))
|
|
assert.Error(t, c.CheckValidDataType(schemapb.DataType_Array))
|
|
assert.Error(t, c.CheckValidDataType(schemapb.DataType_FloatVector))
|
|
}
|