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

Function TestStackSkipField

field_test.go:278–285  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

276}
277
278func TestStackSkipField(t *testing.T) {
279 f := StackSkip("stacktrace", 0)
280 assert.Equal(t, "stacktrace", f.Key, "Unexpected field key.")
281 assert.Equal(t, zapcore.StringType, f.Type, "Unexpected field type.")
282 r := regexp.MustCompile(`field_test.go:(\d+)`)
283 assert.Equal(t, r.ReplaceAllString(stacktrace.Take(0), "field_test.go"), r.ReplaceAllString(f.String, "field_test.go"), f.String, "Unexpected stack trace")
284 assertCanBeReused(t, f)
285}
286
287func TestStackSkipFieldWithSkip(t *testing.T) {
288 f := StackSkip("stacktrace", 1)

Callers

nothing calls this directly

Calls 3

TakeFunction · 0.92
StackSkipFunction · 0.85
assertCanBeReusedFunction · 0.70

Tested by

no test coverage detected