TestSpec_SlogIntegration_NewSlogLoggerWithHandler validates the convenience constructor. Spec section: "### NewSlogLoggerWithHandler(logger *Logger) *slog.Logger"
(t *testing.T)
| 191 | // TestSpec_SlogIntegration_NewSlogLoggerWithHandler validates the convenience constructor. |
| 192 | // Spec section: "### NewSlogLoggerWithHandler(logger *Logger) *slog.Logger" |
| 193 | func TestSpec_SlogIntegration_NewSlogLoggerWithHandler(t *testing.T) { |
| 194 | t.Run("NewSlogLoggerWithHandler returns a non-nil slog.Logger", func(t *testing.T) { |
| 195 | // Spec: "Convenience constructor that creates both the SlogHandler and the slog.Logger in one call." |
| 196 | log := logger.New("spec:slog-convenience") |
| 197 | slogLogger := logger.NewSlogLoggerWithHandler(log) |
| 198 | require.NotNil(t, slogLogger, "NewSlogLoggerWithHandler should return a non-nil slog.Logger") |
| 199 | }) |
| 200 | |
| 201 | t.Run("resulting slog.Logger can log at any level without panic", func(t *testing.T) { |
| 202 | log := logger.New("spec:slog-levels") |
| 203 | slogLogger := logger.NewSlogLoggerWithHandler(log) |
| 204 | // Must not panic regardless of enabled state |
| 205 | assert.NotPanics(t, func() { |
| 206 | slogLogger.Info("info message", "key", "value") |
| 207 | slogLogger.Warn("warn message", "count", 42) |
| 208 | slogLogger.Error("error message") |
| 209 | slogLogger.Debug("debug message") |
| 210 | }, "slog.Logger methods should not panic") |
| 211 | }) |
| 212 | } |
| 213 | |
| 214 | // TestSpec_ThreadSafety_ConcurrentUse validates the documented thread-safety guarantee. |
| 215 | // Spec section: "## Features — Thread-safe: Safe for concurrent use" |
nothing calls this directly
no test coverage detected