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

Function ElementsMatch

require/require.go:95–103  ·  require/require.go::ElementsMatch

ElementsMatch asserts that the specified listA(array, slice...) is equal to specified listB(array, slice...) ignoring the order of the elements. If there are duplicate elements, the number of appearances of each of them in both lists should match. require.ElementsMatch(t, [1, 3, 2, 3], [1, 3, 3, 2]

(t TestingT, listA interface{}, listB interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

93//
94// require.ElementsMatch(t, [1, 3, 2, 3], [1, 3, 3, 2])
95func ElementsMatch(t TestingT, listA interface{}, listB interface{}, msgAndArgs ...interface{}) {
96 if h, ok := t.(tHelper); ok {
97 h.Helper()
98 }
99 if assert.ElementsMatch(t, listA, listB, msgAndArgs...) {
100 return
101 }
102 t.FailNow()
103}
104
105// ElementsMatchf asserts that the specified listA(array, slice...) is equal to specified
106// listB(array, slice...) ignoring the order of the elements. If there are duplicate elements,

Callers 1

ElementsMatchMethod · 0.70

Calls 3

ElementsMatchFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected