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

Function formatListDiff

assert/assertions.go:1210–1228  ·  assert/assertions.go::formatListDiff
(listA, listB interface{}, extraA, extraB []interface{})

Source from the content-addressed store, hash-verified

1208}
1209
1210func formatListDiff(listA, listB interface{}, extraA, extraB []interface{}) string {
1211 var msg bytes.Buffer
1212
1213 msg.WriteString("elements differ")
1214 if len(extraA) > 0 {
1215 msg.WriteString("\n\nextra elements in list A:\n")
1216 msg.WriteString(spewConfig.Sdump(extraA))
1217 }
1218 if len(extraB) > 0 {
1219 msg.WriteString("\n\nextra elements in list B:\n")
1220 msg.WriteString(spewConfig.Sdump(extraB))
1221 }
1222 msg.WriteString("\n\nlistA:\n")
1223 msg.WriteString(spewConfig.Sdump(listA))
1224 msg.WriteString("\n\nlistB:\n")
1225 msg.WriteString(spewConfig.Sdump(listB))
1226
1227 return msg.String()
1228}
1229
1230// NotElementsMatch asserts that the specified listA(array, slice...) is NOT equal to specified
1231// listB(array, slice...) ignoring the order of the elements. If there are duplicate elements,

Callers 1

ElementsMatchFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected