MCPcopy
hub / github.com/rs/zerolog / TestSlogHandler_WithBoolAttr

Function TestSlogHandler_WithBoolAttr

slog_test.go:120–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

118}
119
120func TestSlogHandler_WithBoolAttr(t *testing.T) {
121 var buf bytes.Buffer
122 logger := newSlogLogger(&buf)
123
124 logger.Info("test", slog.Bool("flag", true))
125
126 m := decodeJSON(t, &buf)
127 if m["flag"] != true {
128 t.Errorf("expected flag=true, got %v", m["flag"])
129 }
130}
131
132func TestSlogHandler_WithFloat64Attr(t *testing.T) {
133 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 4

newSlogLoggerFunction · 0.85
decodeJSONFunction · 0.85
InfoMethod · 0.65
BoolMethod · 0.45

Tested by

no test coverage detected