MCPcopy Create free account
hub / github.com/bracesdev/errtrace / wantErr

Function wantErr

wrap_caller_test.go:103–113  ·  view source on GitHub ↗
(t testing.TB, err error, fn string)

Source from the content-addressed store, hash-verified

101}
102
103func wantErr(t testing.TB, err error, fn string) runtime.Frame {
104 if err == nil {
105 t.Fatalf("expected err")
106 }
107
108 f, _, _ := errtrace.UnwrapFrame(err)
109 if !strings.HasSuffix(f.Function, "."+fn) {
110 t.Errorf("expected caller to be %v, got %v", fn, f.Function)
111 }
112 return f
113}

Calls 1

UnwrapFrameFunction · 0.92

Tested by

no test coverage detected