forked from getsentry/sentry-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstacktrace_go1.20_test.go
More file actions
32 lines (27 loc) · 821 Bytes
/
stacktrace_go1.20_test.go
File metadata and controls
32 lines (27 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//go:build go1.20
package sentry
import (
"testing"
"github.com/google/go-cmp/cmp"
)
func TestFilterCompilerGeneratedSymbols(t *testing.T) {
tests := []struct {
symbol string
expectedPackageName string
}{
{"type:.eq.[9]debug/elf.intName", ""},
{"type:.hash.debug/elf.ProgHeader", ""},
{"type:.eq.runtime._panic", ""},
{"type:.hash.struct { runtime.gList; runtime.n int32 }", ""},
{"go:(*struct { sync.Mutex; math/big.table [64]math/big", ""},
{"go.uber.org/zap/buffer.(*Buffer).AppendString", "go.uber.org/zap/buffer"},
}
for _, tt := range tests {
t.Run(tt.symbol, func(t *testing.T) {
packageName := packageName(tt.symbol)
if diff := cmp.Diff(tt.expectedPackageName, packageName); diff != "" {
t.Errorf("Package name mismatch (-want +got):\n%s", diff)
}
})
}
}