mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 11:29:48 +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>
44 lines
696 B
Go
44 lines
696 B
Go
package common
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestCloneByteSlice(t *testing.T) {
|
|
type args struct {
|
|
s ByteSlice
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
want ByteSlice
|
|
}{
|
|
{
|
|
args: args{s: []byte{0x0}},
|
|
want: []byte{0x0},
|
|
},
|
|
{
|
|
args: args{s: []byte{0xff}},
|
|
want: []byte{0xff},
|
|
},
|
|
{
|
|
args: args{s: []byte{0x0f}},
|
|
want: []byte{0x0f},
|
|
},
|
|
{
|
|
args: args{s: []byte{0xf0}},
|
|
want: []byte{0xf0},
|
|
}, {
|
|
args: args{s: []byte{0x0, 0xff, 0x0f, 0xf0}},
|
|
want: []byte{0x0, 0xff, 0x0f, 0xf0},
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
assert.True(t, tt.want.Equal(tt.args.s))
|
|
})
|
|
}
|
|
}
|