MCPcopy Create free account
hub / github.com/temporalio/temporal / formatListDiff

Function formatListDiff

common/testing/protoassert/testify_assert.go:13–31  ·  view source on GitHub ↗
(listA, listB any, extraA, extraB any)

Source from the content-addressed store, hash-verified

11)
12
13func formatListDiff(listA, listB any, extraA, extraB any) string {
14 var msg bytes.Buffer
15
16 msg.WriteString("elements differ")
17 if !isEmpty(extraA) {
18 msg.WriteString("\n\nextra elements in list A:\n")
19 msg.WriteString(prettyPrint(extraA))
20 }
21 if !isEmpty(extraB) {
22 msg.WriteString("\n\nextra elements in list B:\n")
23 msg.WriteString(prettyPrint(extraB))
24 }
25 msg.WriteString("\n\nlistA:\n")
26 msg.WriteString(prettyPrint(listA))
27 msg.WriteString("\n\nlistB:\n")
28 msg.WriteString(prettyPrint(listB))
29
30 return msg.String()
31}
32
33func diffLists(listA, listB any) (extraA, extraB []any) {
34 aValue := reflect.ValueOf(listA)

Callers 1

ProtoElementsMatchFunction · 0.85

Calls 3

isEmptyFunction · 0.85
prettyPrintFunction · 0.85
StringMethod · 0.65

Tested by

no test coverage detected