| 1208 | } |
| 1209 | |
| 1210 | func 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, |