milvus/internal/common/key_value_pairs_test.go
Jiquan Long a5e2d6b6fb
Refactor RootCoord (#18930)
Signed-off-by: longjiquan <jiquan.long@zilliz.com>
Co-authored-by: xaxys <tpnnghd@163.com>

Signed-off-by: longjiquan <jiquan.long@zilliz.com>
Co-authored-by: xaxys <tpnnghd@163.com>
2022-09-05 13:29:11 +08:00

43 lines
710 B
Go

package common
import (
"testing"
"github.com/milvus-io/milvus/internal/proto/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))
})
}
}