MCPcopy
hub / github.com/uber-go/zap / TestTakeDeepStack

Function TestTakeDeepStack

internal/stacktrace/stack_test.go:71–87  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

69}
70
71func TestTakeDeepStack(t *testing.T) {
72 const (
73 N = 500
74 withStackDepthName = "go.uber.org/zap/internal/stacktrace.withStackDepth"
75 )
76 withStackDepth(N, func() {
77 trace := Take(0)
78 for found := 0; found < N; found++ {
79 i := strings.Index(trace, withStackDepthName)
80 if i < 0 {
81 t.Fatalf(`expected %v occurrences of %q, found %d`,
82 N, withStackDepthName, found)
83 }
84 trace = trace[i+len(withStackDepthName):]
85 }
86 })
87}
88
89func BenchmarkTake(b *testing.B) {
90 for i := 0; i < b.N; i++ {

Callers

nothing calls this directly

Calls 3

withStackDepthFunction · 0.85
TakeFunction · 0.85
FatalfMethod · 0.45

Tested by

no test coverage detected