MCPcopy Index your code
hub / github.com/google/go-github / assertErr

Method assertErr

tools/metadata/main_test.go:304–313  ·  view source on GitHub ↗
(want string)

Source from the content-addressed store, hash-verified

302}
303
304func (r testRun) assertErr(want string) {
305 r.t.Helper()
306 if r.err == nil {
307 r.t.Error("expected error")
308 return
309 }
310 if strings.TrimSpace(r.err.Error()) != strings.TrimSpace(want) {
311 r.t.Errorf("unexpected error:\nwant:\n%v\ngot:\n%v", want, r.err.Error())
312 }
313}
314
315func runTest(t *testing.T, srcDir string, args ...string) testRun {
316 t.Helper()

Callers 1

TestUpdateGoFunction · 0.80

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected