(t *testing.T)
| 155 | } |
| 156 | |
| 157 | func TestSlogHandler_WithDurationAttr(t *testing.T) { |
| 158 | var buf bytes.Buffer |
| 159 | logger := newSlogLogger(&buf) |
| 160 | |
| 161 | logger.Info("test", slog.Duration("elapsed", 5*time.Second)) |
| 162 | |
| 163 | m := decodeJSON(t, &buf) |
| 164 | if m["elapsed"] == nil { |
| 165 | t.Error("expected elapsed field to be present") |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | func TestSlogHandler_WithErrorAttr(t *testing.T) { |
| 170 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected