(t *testing.T)
| 65 | } |
| 66 | |
| 67 | func TestCallbacksGetCalled(t *testing.T) { |
| 68 | gs := New() |
| 69 | |
| 70 | c := make(chan int, 100) |
| 71 | for i := 0; i < 15; i++ { |
| 72 | gs.AddShutdownCallback(ShutdownFunc(func(string) error { |
| 73 | c <- 1 |
| 74 | return nil |
| 75 | })) |
| 76 | } |
| 77 | |
| 78 | gs.StartShutdown(SMFinishFunc(func() error { |
| 79 | return nil |
| 80 | })) |
| 81 | |
| 82 | if len(c) != 15 { |
| 83 | t.Error("Expected 15 elements in channel, got ", len(c)) |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | func TestStartGetsCalled(t *testing.T) { |
| 88 | gs := New() |
nothing calls this directly
no test coverage detected
searching dependent graphs…