MCPcopy Index your code
hub / github.com/maruel/panicparse / TestStackLines

Function TestStackLines

internal/ui_test.go:105–171  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

103}
104
105func TestStackLines(t *testing.T) {
106 t.Parallel()
107 s := &stack.Signature{
108 State: "idle",
109 Stack: stack.Stack{
110 Calls: []stack.Call{
111 newCallLocal(
112 "runtime.Epollwait",
113 stack.Args{
114 Values: []stack.Arg{
115 {Value: 4},
116 {Value: 0x7fff671c7118},
117 {Value: 0xffffffff00000080},
118 {},
119 {Value: 0xffffffff0028c1be},
120 {},
121 {},
122 {},
123 {},
124 {},
125 },
126 Elided: true,
127 },
128 "/goroot/src/runtime/sys_linux_amd64.s",
129 400),
130 newCallLocal(
131 "runtime.netpoll",
132 stack.Args{Values: []stack.Arg{{Value: 0x901b01}, {}}},
133 "/goroot/src/runtime/netpoll_epoll.go",
134 68),
135 newCallLocal(
136 "main.Main",
137 stack.Args{Values: []stack.Arg{{Value: 0xc208012000}}},
138 "/home/user/go/src/main.go",
139 1472),
140 newCallLocal(
141 "foo.OtherExported",
142 stack.Args{},
143 "/home/user/go/src/foo/bar.go",
144 1575),
145 newCallLocal(
146 "foo.otherPrivate",
147 stack.Args{},
148 "/home/user/go/src/foo/bar.go",
149 10),
150 },
151 Elided: true,
152 },
153 }
154 // When printing, it prints the remote path, not the transposed local path.
155 want := "" +
156 " Eruntime F/goroot/src/runtime/sys_linux_amd64.s:400 QEpollwaitR(4, 0x7fff671c7118, 0xffffffff00000080, 0, 0xffffffff0028c1be, 0, 0, 0, 0, 0, ...)A\n" +
157 " Eruntime F/goroot/src/runtime/netpoll_epoll.go:68 PnetpollR(0x901b01, 0)A\n" +
158 " Emain F/home/user/go/src/main.go:1472 GMainR(0xc208012000)A\n" +
159 " Efoo F/home/user/go/src/foo/bar.go:1575 MOtherExportedR()A\n" +
160 " Efoo F/home/user/go/src/foo/bar.go:10 LotherPrivateR()A\n" +
161 " (...)\n"
162 compareString(t, want, testPalette.StackLines(s, 10, 10, fullPath))

Callers

nothing calls this directly

Calls 3

StackLinesMethod · 0.80
newCallLocalFunction · 0.70
compareStringFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…