mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 04:49:08 +08:00
98ceb162aa
Signed-off-by: dragondriver <jiquan.long@zilliz.com> Co-authored-by: xaxys <tpnnghd@163.com> Co-authored-by: xaxys <tpnnghd@163.com>
27 lines
721 B
Go
27 lines
721 B
Go
package planparserv2
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/milvus-io/milvus/internal/util/typeutil"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCheckIdentical(t *testing.T) {
|
|
schema := newTestSchema()
|
|
helper, err := typeutil.CreateSchemaHelper(schema)
|
|
assert.NoError(t, err)
|
|
|
|
exprStr1 := `not (((Int64Field > 0) and (FloatField <= 20.0)) or ((Int32Field in [1, 2, 3]) and (VarCharField < "str")))`
|
|
exprStr2 := `Int32Field in [1, 2, 3]`
|
|
|
|
expr1, err := ParseExpr(helper, exprStr1)
|
|
assert.NoError(t, err)
|
|
expr2, err := ParseExpr(helper, exprStr2)
|
|
assert.NoError(t, err)
|
|
|
|
assert.True(t, CheckIdentical(expr1, expr1))
|
|
assert.True(t, CheckIdentical(expr2, expr2))
|
|
assert.False(t, CheckIdentical(expr1, expr2))
|
|
}
|