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

Function TestFuncInit

stack/stack_test.go:20–79  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

18)
19
20func TestFuncInit(t *testing.T) {
21 t.Parallel()
22 data := []struct {
23 raw string
24 want Func
25 }{
26 {
27 "github.com/maruel/panicparse/cmd/panic/internal/%c3%b9tf8.(*Strùct).Pànic",
28 Func{
29 Complete: "github.com/maruel/panicparse/cmd/panic/internal/ùtf8.(*Strùct).Pànic",
30 ImportPath: "github.com/maruel/panicparse/cmd/panic/internal/ùtf8",
31 DirName: "ùtf8",
32 Name: "(*Strùct).Pànic",
33 IsExported: true,
34 },
35 },
36 {
37 "gopkg.in/yaml%2ev2.handleErr",
38 Func{
39 Complete: "gopkg.in/yaml.v2.handleErr",
40 ImportPath: "gopkg.in/yaml.v2",
41 DirName: "yaml.v2",
42 Name: "handleErr",
43 },
44 },
45 {
46 "github.com/maruel/panicparse/vendor/golang.org/x/sys/unix.Nanosleep",
47 Func{
48 Complete: "github.com/maruel/panicparse/vendor/golang.org/x/sys/unix.Nanosleep",
49 ImportPath: "github.com/maruel/panicparse/vendor/golang.org/x/sys/unix",
50 DirName: "unix",
51 Name: "Nanosleep",
52 IsExported: true,
53 },
54 },
55 {
56 "main.func·001",
57 Func{
58 Complete: "main.func·001",
59 ImportPath: "main",
60 DirName: "main",
61 Name: "func·001",
62 IsPkgMain: true,
63 },
64 },
65 {
66 "gc",
67 Func{
68 Complete: "gc",
69 Name: "gc",
70 },
71 },
72 }
73 for _, line := range data {
74 got := newFunc(line.raw)
75 if diff := cmp.Diff(line.want, got); diff != "" {
76 t.Fatalf("Call mismatch (-want +got):\n%s", diff)
77 }

Callers

nothing calls this directly

Calls 1

newFuncFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…