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

Function TestTakeWithSkipInnerFunc

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

Source from the content-addressed store, hash-verified

54}
55
56func TestTakeWithSkipInnerFunc(t *testing.T) {
57 var trace string
58 func() {
59 trace = Take(2)
60 }()
61 lines := strings.Split(trace, "\n")
62 require.NotEmpty(t, lines, "Expected stacktrace to have at least one frame.")
63 assert.Contains(
64 t,
65 lines[0],
66 "testing.",
67 "Expected stacktrace to start with the test function (skipping the test function).",
68 )
69}
70
71func TestTakeDeepStack(t *testing.T) {
72 const (

Callers

nothing calls this directly

Calls 1

TakeFunction · 0.85

Tested by

no test coverage detected