(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestLogger_LogFn(t *testing.T) { |
| 11 | log.SetFormatter(&log.JSONFormatter{}) |
| 12 | log.SetLevel(log.WarnLevel) |
| 13 | |
| 14 | notCalled := 0 |
| 15 | log.InfoFn(func() []interface{} { |
| 16 | notCalled++ |
| 17 | return []interface{}{ |
| 18 | "Hello", |
| 19 | } |
| 20 | }) |
| 21 | assert.Equal(t, 0, notCalled) |
| 22 | |
| 23 | called := 0 |
| 24 | log.ErrorFn(func() []interface{} { |
| 25 | called++ |
| 26 | return []interface{}{ |
| 27 | "Oopsi", |
| 28 | } |
| 29 | }) |
| 30 | assert.Equal(t, 1, called) |
| 31 | } |
nothing calls this directly
no test coverage detected