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

Function TestAggregateExactMatching

stack/bucket_test.go:90–150  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestAggregateExactMatching(t *testing.T) {
91 t.Parallel()
92 // 2 goroutines with the exact same signature.
93 data := []string{
94 "panic: runtime error: index out of range",
95 "",
96 "goroutine 6 [chan receive]:",
97 "main.func·001({0x11000000, 2}, 3)",
98 "\t/gopath/src/github.com/maruel/panicparse/stack/stack.go:72 +0x49",
99 "created by main.mainImpl",
100 "\t/gopath/src/github.com/maruel/panicparse/stack/stack.go:74 +0xeb",
101 "",
102 "goroutine 7 [chan receive]:",
103 "main.func·001({0x11000000, 2}, 3)",
104 "\t/gopath/src/github.com/maruel/panicparse/stack/stack.go:72 +0x49",
105 "created by main.mainImpl",
106 "\t/gopath/src/github.com/maruel/panicparse/stack/stack.go:74 +0xeb",
107 "",
108 }
109 s, suffix, err := ScanSnapshot(bytes.NewBufferString(strings.Join(data, "\n")), io.Discard, defaultOpts())
110 if err != io.EOF {
111 t.Fatal(err)
112 }
113 if s == nil {
114 t.Fatal("expected snapshot")
115 }
116 want := []*Bucket{
117 {
118 Signature: Signature{
119 State: "chan receive",
120 CreatedBy: Stack{
121 Calls: []Call{
122 newCall(
123 "main.mainImpl",
124 Args{},
125 "/gopath/src/github.com/maruel/panicparse/stack/stack.go",
126 74),
127 },
128 },
129 Stack: Stack{
130 Calls: []Call{
131 newCall(
132 "main.func·001",
133 Args{Values: []Arg{
134 {IsAggregate: true, Fields: Args{
135 Values: []Arg{{Value: 0x11000000, Name: "#1", IsPtr: true}, {Value: 2}},
136 }},
137 {Value: 3},
138 }},
139 "/gopath/src/github.com/maruel/panicparse/stack/stack.go",
140 72),
141 },
142 },
143 },
144 IDs: []int{6, 7},
145 First: true,
146 },
147 }

Callers

nothing calls this directly

Calls 6

ScanSnapshotFunction · 0.85
defaultOptsFunction · 0.85
newCallFunction · 0.85
compareBucketsFunction · 0.85
AggregateMethod · 0.80
compareStringFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…