MCPcopy Index your code
hub / github.com/pkg/errors / TestErrorf

Function TestErrorf

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

Source from the content-addressed store, hash-verified

133}
134
135func TestErrorf(t *testing.T) {
136 tests := []struct {
137 err error
138 want string
139 }{
140 {Errorf("read error without format specifiers"), "read error without format specifiers"},
141 {Errorf("read error with %d format specifier", 1), "read error with 1 format specifier"},
142 }
143
144 for _, tt := range tests {
145 got := tt.err.Error()
146 if got != tt.want {
147 t.Errorf("Errorf(%v): got: %q, want %q", tt.err, got, tt.want)
148 }
149 }
150}
151
152func TestWithStackNil(t *testing.T) {
153 got := WithStack(nil)

Callers

nothing calls this directly

Calls 2

ErrorfFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…