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

Function TestFrameFormat

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

Source from the content-addressed store, hash-verified

21}
22
23func TestFrameFormat(t *testing.T) {
24 var tests = []struct {
25 Frame
26 format string
27 want string
28 }{{
29 initpc,
30 "%s",
31 "stack_test.go",
32 }, {
33 initpc,
34 "%+s",
35 "github.com/pkg/errors.init\n" +
36 "\t.+/github.com/pkg/errors/stack_test.go",
37 }, {
38 0,
39 "%s",
40 "unknown",
41 }, {
42 0,
43 "%+s",
44 "unknown",
45 }, {
46 initpc,
47 "%d",
48 "9",
49 }, {
50 0,
51 "%d",
52 "0",
53 }, {
54 initpc,
55 "%n",
56 "init",
57 }, {
58 func() Frame {
59 var x X
60 return x.ptr()
61 }(),
62 "%n",
63 `\(\*X\).ptr`,
64 }, {
65 func() Frame {
66 var x X
67 return x.val()
68 }(),
69 "%n",
70 "X.val",
71 }, {
72 0,
73 "%n",
74 "",
75 }, {
76 initpc,
77 "%v",
78 "stack_test.go:9",
79 }, {
80 initpc,

Callers

nothing calls this directly

Calls 3

ptrMethod · 0.95
valMethod · 0.95
testFormatRegexpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…