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

Function TestSlogHandler_WithFloat64Attr

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

Source from the content-addressed store, hash-verified

130}
131
132func TestSlogHandler_WithFloat64Attr(t *testing.T) {
133 var buf bytes.Buffer
134 logger := newSlogLogger(&buf)
135
136 logger.Info("test", slog.Float64("pi", 3.14))
137
138 m := decodeJSON(t, &buf)
139 if m["pi"] != 3.14 {
140 t.Errorf("expected pi=3.14, got %v", m["pi"])
141 }
142}
143
144func TestSlogHandler_WithTimeAttr(t *testing.T) {
145 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 4

newSlogLoggerFunction · 0.85
decodeJSONFunction · 0.85
InfoMethod · 0.65
Float64Method · 0.45

Tested by

no test coverage detected