(t *testing.T)
| 226 | } |
| 227 | |
| 228 | func TestLineHandlerSystemdFormat(t *testing.T) { |
| 229 | var buf bytes.Buffer |
| 230 | handler := newLineHandler(&buf, slog.LevelDebug, false, true) |
| 231 | |
| 232 | record := slog.NewRecord( |
| 233 | time.Date(2024, time.January, 2, 3, 4, 5, 0, time.UTC), |
| 234 | slog.LevelWarn, |
| 235 | "systemd", |
| 236 | 0, |
| 237 | ) |
| 238 | if err := handler.Handle(context.Background(), record); err != nil { |
| 239 | t.Fatalf("Handle returned error: %v", err) |
| 240 | } |
| 241 | |
| 242 | out := buf.String() |
| 243 | if got, want := out, "[WARN] systemd\n"; got != want { |
| 244 | t.Fatalf("systemd output = %q, want %q", got, want) |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | func TestLoggerHelpers(t *testing.T) { |
| 249 | if got := normalizeArgs(); got != "" { |
nothing calls this directly
no test coverage detected