(t *testing.T)
| 397 | } |
| 398 | |
| 399 | func TestDurationFormattingTextFormat(t *testing.T) { |
| 400 | var buf bytes.Buffer |
| 401 | logger := NewSlogLogger( |
| 402 | WithOutput(&buf), |
| 403 | WithFormat(FormatText), |
| 404 | ) |
| 405 | |
| 406 | logger.Info("test message", slog.Duration("duration", 6*time.Hour)) |
| 407 | |
| 408 | output := buf.String() |
| 409 | // Text format should also show human-readable duration |
| 410 | assert.Contains(t, output, "duration=6h0m0s") |
| 411 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…