Debian Codegraph @

gcp/setup_test.go

raw symbols SCIP
1 package gcp
2
3 import (
4 "context"
5 "log/slog"
6 "testing"
7 )
8
9 func TestHandler(t *testing.T) {
10 ctx := context.Background()
11 l := slog.New(NewHandler(slog.LevelInfo))
12 l.With("level", "INFO").Log(ctx, slog.LevelInfo, "hello world") // okay
13 l.With("level", "INFO").Log(ctx, slog.LevelWarn, "hello world") // weird, but okay (info)
14
15 // These should not panic.
16 l.With("level", nil).Log(ctx, slog.LevelInfo, "hello world")
17 l.With("level", 123).Log(ctx, slog.LevelInfo, "hello world")
18 l.With("level", map[string]string{}).Log(ctx, slog.LevelInfo, "hello world")
19 }