(t *testing.T)
| 69 | } |
| 70 | |
| 71 | func 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 | |
| 89 | func BenchmarkTake(b *testing.B) { |
| 90 | for i := 0; i < b.N; i++ { |
nothing calls this directly
no test coverage detected