(t *testing.T)
| 173 | } |
| 174 | |
| 175 | func TestErrorHandlerFromFinishShutdown(t *testing.T) { |
| 176 | c := make(chan int, 100) |
| 177 | gs := New() |
| 178 | |
| 179 | gs.SetErrorHandler(ErrorFunc(func(err error) { |
| 180 | if err.Error() == "my-error" { |
| 181 | c <- 1 |
| 182 | } |
| 183 | })) |
| 184 | |
| 185 | gs.StartShutdown(SMFinishFunc(func() error { |
| 186 | return errors.New("my-error") |
| 187 | })) |
| 188 | |
| 189 | if len(c) != 1 { |
| 190 | t.Error("Expected 1 error from ShutdownFinish, got ", len(c)) |
| 191 | } |
| 192 | } |
| 193 | |
| 194 | func TestErrorHandlerFromCallbacks(t *testing.T) { |
| 195 | c := make(chan int, 100) |
nothing calls this directly
no test coverage detected
searching dependent graphs…