MCPcopy
hub / github.com/connectrpc/connect-go / report

Function report

internal/assert/assert.go:174–187  ·  view source on GitHub ↗
(tb testing.TB, got, want any, desc string, showWant bool, options ...Option)

Source from the content-addressed store, hash-verified

172}
173
174func report(tb testing.TB, got, want any, desc string, showWant bool, options ...Option) {
175 tb.Helper()
176 buffer := &bytes.Buffer{}
177 if len(options) > 0 {
178 buffer.WriteString(options[len(options)-1].message())
179 }
180 buffer.WriteString("\n")
181 fmt.Fprintf(buffer, "assertion:\t%s\n", desc)
182 fmt.Fprintf(buffer, "got:\t%+v\n", got)
183 if showWant {
184 fmt.Fprintf(buffer, "want:\t%+v\n", want)
185 }
186 tb.Error(buffer.String())
187}
188
189func isNil(got any) bool {
190 // Simple case, true only when the user directly passes a literal nil.

Callers 11

EqualFunction · 0.85
NotEqualFunction · 0.85
NilFunction · 0.85
NotNilFunction · 0.85
ZeroFunction · 0.85
NotZeroFunction · 0.85
MatchFunction · 0.85
ErrorIsFunction · 0.85
FalseFunction · 0.85
TrueFunction · 0.85
PanicsFunction · 0.85

Calls 3

ErrorMethod · 0.80
messageMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected