MCPcopy
hub / github.com/pkg/errors / TestWithStack

Function TestWithStack

errors_test.go:159–174  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

157}
158
159func TestWithStack(t *testing.T) {
160 tests := []struct {
161 err error
162 want string
163 }{
164 {io.EOF, "EOF"},
165 {WithStack(io.EOF), "EOF"},
166 }
167
168 for _, tt := range tests {
169 got := WithStack(tt.err).Error()
170 if got != tt.want {
171 t.Errorf("WithStack(%v): got: %v, want %v", tt.err, got, tt.want)
172 }
173 }
174}
175
176func TestWithMessageNil(t *testing.T) {
177 got := WithMessage(nil, "no error")

Callers

nothing calls this directly

Calls 2

WithStackFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…