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

Function TestStackTraceFormat

stack_test.go:179–241  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

177}
178
179func TestStackTraceFormat(t *testing.T) {
180 tests := []struct {
181 StackTrace
182 format string
183 want string
184 }{{
185 nil,
186 "%s",
187 `\[\]`,
188 }, {
189 nil,
190 "%v",
191 `\[\]`,
192 }, {
193 nil,
194 "%+v",
195 "",
196 }, {
197 nil,
198 "%#v",
199 `\[\]errors.Frame\(nil\)`,
200 }, {
201 make(StackTrace, 0),
202 "%s",
203 `\[\]`,
204 }, {
205 make(StackTrace, 0),
206 "%v",
207 `\[\]`,
208 }, {
209 make(StackTrace, 0),
210 "%+v",
211 "",
212 }, {
213 make(StackTrace, 0),
214 "%#v",
215 `\[\]errors.Frame{}`,
216 }, {
217 stackTrace()[:2],
218 "%s",
219 `\[stack_test.go stack_test.go\]`,
220 }, {
221 stackTrace()[:2],
222 "%v",
223 `\[stack_test.go:174 stack_test.go:221\]`,
224 }, {
225 stackTrace()[:2],
226 "%+v",
227 "\n" +
228 "github.com/pkg/errors.stackTrace\n" +
229 "\t.+/github.com/pkg/errors/stack_test.go:174\n" +
230 "github.com/pkg/errors.TestStackTraceFormat\n" +
231 "\t.+/github.com/pkg/errors/stack_test.go:225",
232 }, {
233 stackTrace()[:2],
234 "%#v",
235 `\[\]errors.Frame{stack_test.go:174, stack_test.go:233}`,
236 }}

Callers

nothing calls this directly

Calls 2

stackTraceFunction · 0.85
testFormatRegexpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…