Test_WithContextNilCaller runs serially because it mutates the package-global logger and output to verify caller attribution.
(t *testing.T)
| 77 | // Test_WithContextNilCaller runs serially because it mutates the package-global |
| 78 | // logger and output to verify caller attribution. |
| 79 | func 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 |
nothing calls this directly
no test coverage detected