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

Function TestLevel_String

log_test.go:1315–1338  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1313}
1314
1315func TestLevel_String(t *testing.T) {
1316 tests := []struct {
1317 name string
1318 l Level
1319 want string
1320 }{
1321 {"trace", TraceLevel, "trace"},
1322 {"debug", DebugLevel, "debug"},
1323 {"info", InfoLevel, "info"},
1324 {"warn", WarnLevel, "warn"},
1325 {"error", ErrorLevel, "error"},
1326 {"fatal", FatalLevel, "fatal"},
1327 {"panic", PanicLevel, "panic"},
1328 {"disabled", Disabled, "disabled"},
1329 {"nolevel", NoLevel, ""},
1330 }
1331 for _, tt := range tests {
1332 t.Run(tt.name, func(t *testing.T) {
1333 if got := tt.l.String(); got != tt.want {
1334 t.Errorf("String() = %v, want %v", got, tt.want)
1335 }
1336 })
1337 }
1338}
1339
1340func TestLevel_MarshalText(t *testing.T) {
1341 tests := []struct {

Callers

nothing calls this directly

Calls 2

RunMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected