(t *testing.T)
| 31 | ) |
| 32 | |
| 33 | func TestLevelEnablerFunc(t *testing.T) { |
| 34 | enab := LevelEnablerFunc(func(l zapcore.Level) bool { return l == zapcore.InfoLevel }) |
| 35 | tests := []struct { |
| 36 | level zapcore.Level |
| 37 | enabled bool |
| 38 | }{ |
| 39 | {DebugLevel, false}, |
| 40 | {InfoLevel, true}, |
| 41 | {WarnLevel, false}, |
| 42 | {ErrorLevel, false}, |
| 43 | {DPanicLevel, false}, |
| 44 | {PanicLevel, false}, |
| 45 | {FatalLevel, false}, |
| 46 | } |
| 47 | for _, tt := range tests { |
| 48 | assert.Equal(t, tt.enabled, enab.Enabled(tt.level), "Unexpected result applying LevelEnablerFunc to %s", tt.level) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | func TestNewAtomicLevel(t *testing.T) { |
| 53 | lvl := NewAtomicLevel() |
nothing calls this directly
no test coverage detected