89
// ProtoElementsMatch behaves like require.ElementsMatch except in that it works for protobuf-generated structs.
90
// Both arguments must be slices or arrays.
92
>
if th, ok := t.(helper); ok {
93
th.Helper()
94
}
96
>
bVal := reflect.ValueOf(b)
97
>
if aVal.Len() != bVal.Len() {
98
require.Fail(t, fmt.Sprintf("element count mismatch: want %d, got %d\nA: %+v\nB: %+v", aVal.Len(), bVal.Len(), a, b), msgAndArgs...)
99
return
100
}
102
>
for i := 0; i < aVal.Len(); i++ {
103
>
want := aVal.Index(i).Interface()
104
>
matched := false
105
>
for j := 0; j < bVal.Len(); j++ {
106
>
if used[j] {
108
}
111
>
matched = true
112
>
break
113
}
114
}
116
require.Fail(t, fmt.Sprintf("element not found in B: %+v\nA: %+v\nB: %+v", want, a, b), msgAndArgs...)
117
return