mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-05 21:39:19 +08:00
a5e2d6b6fb
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>
48 lines
1.0 KiB
Go
48 lines
1.0 KiB
Go
package model
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestCheckPartitionsEqual(t *testing.T) {
|
|
type args struct {
|
|
partitionsA []*Partition
|
|
partitionsB []*Partition
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
want bool
|
|
}{
|
|
{
|
|
// length not match.
|
|
args: args{
|
|
partitionsA: []*Partition{{PartitionName: "_default"}},
|
|
partitionsB: []*Partition{},
|
|
},
|
|
want: false,
|
|
},
|
|
{
|
|
args: args{
|
|
partitionsA: []*Partition{{PartitionName: "_default"}},
|
|
partitionsB: []*Partition{{PartitionName: "not_default"}},
|
|
},
|
|
want: false,
|
|
},
|
|
{
|
|
args: args{
|
|
partitionsA: []*Partition{{PartitionName: "_default"}, {PartitionName: "not_default"}},
|
|
partitionsB: []*Partition{{PartitionName: "_default"}, {PartitionName: "not_default"}},
|
|
},
|
|
want: true,
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := CheckPartitionsEqual(tt.args.partitionsA, tt.args.partitionsB); got != tt.want {
|
|
t.Errorf("CheckPartitionsEqual() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|