(got []*grpcLogEntry, want []*grpcLogEntry)
| 41 | ) |
| 42 | |
| 43 | func cmpLoggingEntryList(got []*grpcLogEntry, want []*grpcLogEntry) error { |
| 44 | if diff := cmp.Diff(got, want, |
| 45 | // For nondeterministic metadata iteration. |
| 46 | cmp.Comparer(func(a map[string]string, b map[string]string) bool { |
| 47 | if len(a) > len(b) { |
| 48 | a, b = b, a |
| 49 | } |
| 50 | if len(a) == 0 && len(a) != len(b) { // No metadata for one and the other comparator wants metadata. |
| 51 | return false |
| 52 | } |
| 53 | for k, v := range a { |
| 54 | if b[k] != v { |
| 55 | return false |
| 56 | } |
| 57 | } |
| 58 | return true |
| 59 | }), |
| 60 | cmpopts.IgnoreFields(grpcLogEntry{}, "CallID", "Peer"), |
| 61 | cmpopts.IgnoreFields(address{}, "IPPort", "Type"), |
| 62 | cmpopts.IgnoreFields(payload{}, "Timeout")); diff != "" { |
| 63 | return fmt.Errorf("got unexpected grpcLogEntry list, diff (-got, +want): %v", diff) |
| 64 | } |
| 65 | return nil |
| 66 | } |
| 67 | |
| 68 | type fakeLoggingExporter struct { |
| 69 | t *testing.T |
no test coverage detected