(t *testing.T)
| 142 | } |
| 143 | |
| 144 | func TestSlogHandler_WithTimeAttr(t *testing.T) { |
| 145 | var buf bytes.Buffer |
| 146 | logger := newSlogLogger(&buf) |
| 147 | |
| 148 | ts := time.Date(2024, 1, 15, 12, 0, 0, 0, time.UTC) |
| 149 | logger.Info("test", slog.Time("created", ts)) |
| 150 | |
| 151 | m := decodeJSON(t, &buf) |
| 152 | if m["created"] == nil { |
| 153 | t.Error("expected created field to be present") |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | func TestSlogHandler_WithDurationAttr(t *testing.T) { |
| 158 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected