MCPcopy
hub / github.com/gofiber/fiber / Test_WithContextNilCaller

Function Test_WithContextNilCaller

log/default_test.go:79–96  ·  view source on GitHub ↗

Test_WithContextNilCaller runs serially because it mutates the package-global logger and output to verify caller attribution.

(t *testing.T)

Source from the content-addressed store, hash-verified

77// Test_WithContextNilCaller runs serially because it mutates the package-global
78// logger and output to verify caller attribution.
79func Test_WithContextNilCaller(t *testing.T) {
80 t.Cleanup(initDefaultLogger)
81
82 logger = &defaultLogger{
83 stdlog: log.New(os.Stderr, "", log.Lshortfile),
84 depth: 4,
85 }
86
87 var w byteSliceWriter
88 SetOutput(&w)
89
90 withContextLine := callSiteLine(t) + 1
91 WithContext(nil).Info("")
92 infoLine := callSiteLine(t) + 1
93 Info("")
94
95 expectCallerOutput(t, &w, withContextLine, infoLine)
96}
97
98// Test_WithContextRenderError locks in M8: a misconfigured context tag must
99// not silently drop context — the failure should leave a visible marker in

Callers

nothing calls this directly

Calls 7

SetOutputFunction · 0.85
callSiteLineFunction · 0.85
WithContextFunction · 0.85
InfoFunction · 0.85
expectCallerOutputFunction · 0.85
NewMethod · 0.65
InfoMethod · 0.65

Tested by

no test coverage detected