regression test for deadlock in handlers
(t *testing.T)
| 26 | |
| 27 | // regression test for deadlock in handlers |
| 28 | func TestPluginAddHandler(t *testing.T) { |
| 29 | t.Parallel() |
| 30 | // make a plugin which is pre-activated |
| 31 | p := &Plugin{activateWait: sync.NewCond(&sync.Mutex{})} |
| 32 | p.Manifest = &Manifest{Implements: []string{"bananas"}} |
| 33 | storage.Lock() |
| 34 | storage.plugins["qwerty"] = p |
| 35 | storage.Unlock() |
| 36 | |
| 37 | testActive(t, p) |
| 38 | Handle("bananas", func(_ string, _ *Client) {}) |
| 39 | testActive(t, p) |
| 40 | } |
| 41 | |
| 42 | func TestPluginWaitBadPlugin(t *testing.T) { |
| 43 | p := &Plugin{activateWait: sync.NewCond(&sync.Mutex{})} |
nothing calls this directly
no test coverage detected
searching dependent graphs…