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

Function TestSymbol

stack/html_test.go:208–239  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

206}
207
208func TestSymbol(t *testing.T) {
209 t.Parallel()
210 data := []struct {
211 in Func
212 want template.URL
213 }{
214 {
215 newFunc("github.com/mattn/go-colorable.(*NonColorable).Write"),
216 "NonColorable.Write",
217 },
218 {
219 newFunc("golang.org/x/sys/unix.Nanosleep"),
220 "Nanosleep",
221 },
222 {
223 Func{},
224 "",
225 },
226 {
227 newFunc("main.baz"),
228 "baz",
229 },
230 }
231 for i, line := range data {
232 line := line
233 t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {
234 if s := symbol(&line.in); s != line.want {
235 t.Fatalf("%q != %q", s, line.want)
236 }
237 })
238 }
239}
240
241func TestSnapshot_ToHTML(t *testing.T) {
242 t.Parallel()

Callers

nothing calls this directly

Calls 2

symbolFunction · 0.85
newFuncFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…