MCPcopy
hub / github.com/stretchr/testify / TestBytesEqual

Function TestBytesEqual

assert/assertions_test.go:3093–3106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3091}
3092
3093func TestBytesEqual(t *testing.T) {
3094 t.Parallel()
3095
3096 cases := []struct {
3097 a, b []byte
3098 }{
3099 {make([]byte, 2), make([]byte, 2)},
3100 {make([]byte, 2), make([]byte, 2, 3)},
3101 {nil, make([]byte, 0)},
3102 }
3103 for i, c := range cases {
3104 Equal(t, reflect.DeepEqual(c.a, c.b), ObjectsAreEqual(c.a, c.b), "case %d failed", i+1)
3105 }
3106}
3107
3108func BenchmarkBytesEqual(b *testing.B) {
3109 const size = 1024 * 8

Callers

nothing calls this directly

Calls 2

ObjectsAreEqualFunction · 0.85
EqualFunction · 0.70

Tested by

no test coverage detected