(t *testing.T)
| 1338 | } |
| 1339 | |
| 1340 | func TestLevel_MarshalText(t *testing.T) { |
| 1341 | tests := []struct { |
| 1342 | name string |
| 1343 | l Level |
| 1344 | want string |
| 1345 | }{ |
| 1346 | {"trace", TraceLevel, "trace"}, |
| 1347 | {"debug", DebugLevel, "debug"}, |
| 1348 | {"info", InfoLevel, "info"}, |
| 1349 | {"warn", WarnLevel, "warn"}, |
| 1350 | {"error", ErrorLevel, "error"}, |
| 1351 | {"fatal", FatalLevel, "fatal"}, |
| 1352 | {"panic", PanicLevel, "panic"}, |
| 1353 | {"disabled", Disabled, "disabled"}, |
| 1354 | {"nolevel", NoLevel, ""}, |
| 1355 | } |
| 1356 | for _, tt := range tests { |
| 1357 | t.Run(tt.name, func(t *testing.T) { |
| 1358 | if got, err := tt.l.MarshalText(); err != nil { |
| 1359 | t.Errorf("MarshalText couldn't marshal: %v", tt.l) |
| 1360 | } else if string(got) != tt.want { |
| 1361 | t.Errorf("String() = %v, want %v", string(got), tt.want) |
| 1362 | } |
| 1363 | }) |
| 1364 | } |
| 1365 | } |
| 1366 | |
| 1367 | func TestParseLevel(t *testing.T) { |
| 1368 | type args struct { |
nothing calls this directly
no test coverage detected