(t *testing.T)
| 562 | } |
| 563 | |
| 564 | func TestLevelEncoders(t *testing.T) { |
| 565 | tests := []struct { |
| 566 | name string |
| 567 | expected interface{} // output of encoding InfoLevel |
| 568 | }{ |
| 569 | {"capital", "INFO"}, |
| 570 | {"lower", "info"}, |
| 571 | {"", "info"}, |
| 572 | {"something-random", "info"}, |
| 573 | } |
| 574 | |
| 575 | for _, tt := range tests { |
| 576 | var le LevelEncoder |
| 577 | require.NoError(t, le.UnmarshalText([]byte(tt.name)), "Unexpected error unmarshaling %q.", tt.name) |
| 578 | assertAppended( |
| 579 | t, |
| 580 | tt.expected, |
| 581 | func(arr ArrayEncoder) { le(InfoLevel, arr) }, |
| 582 | "Unexpected output serializing InfoLevel with %q.", tt.name, |
| 583 | ) |
| 584 | } |
| 585 | } |
| 586 | |
| 587 | func TestTimeEncoders(t *testing.T) { |
| 588 | moment := time.Unix(100, 50005000).UTC() |
nothing calls this directly
no test coverage detected