(t *testing.T)
| 57 | } |
| 58 | |
| 59 | func TestCustomHandleError(t *testing.T) { |
| 60 | old := ErrorHandlers |
| 61 | defer func() { ErrorHandlers = old }() |
| 62 | var result error |
| 63 | ErrorHandlers = []func(error){ |
| 64 | func(err error) { |
| 65 | result = err |
| 66 | }, |
| 67 | } |
| 68 | err := fmt.Errorf("test") |
| 69 | HandleError(err) |
| 70 | if result != err { |
| 71 | t.Errorf("did not receive custom handler") |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | func TestGetCaller(t *testing.T) { |
| 76 | tests := []struct { |
nothing calls this directly
no test coverage detected