milvus/pkg/common/key_value_pairs_test.go
jaime c9d0c157ec
Move some modules from internal to public package (#22572)
Signed-off-by: jaime <yun.zhang@zilliz.com>
2023-04-06 19:14:32 +08:00

42 lines
707 B
Go

package common
import (
"testing"
"github.com/milvus-io/milvus-proto/go-api/commonpb"
"github.com/stretchr/testify/assert"
)
func TestCloneKeyValuePairs(t *testing.T) {
type args struct {
pairs KeyValuePairs
}
tests := []struct {
name string
args args
want KeyValuePairs
}{
{
args: args{
pairs: nil,
},
},
{
args: args{
pairs: []*commonpb.KeyValuePair{
{Key: "k1", Value: "v1"},
{Key: "k2", Value: "v2"},
{Key: "k3", Value: "v3"},
{Key: "k4", Value: "v4"},
},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
clone := CloneKeyValuePairs(tt.args.pairs)
assert.True(t, clone.Equal(tt.args.pairs))
})
}
}