(t *testing.T)
| 42 | } |
| 43 | |
| 44 | func TestPublisher_Cancel_willNotBlock(t *testing.T) { |
| 45 | var ( |
| 46 | ok bool |
| 47 | runSync = make(chan bool) |
| 48 | ) |
| 49 | p := newTestPublisher() |
| 50 | |
| 51 | go func() { |
| 52 | <-runSync |
| 53 | p.Cancel() |
| 54 | p.Cancel() |
| 55 | p.Cancel() |
| 56 | ok = true |
| 57 | runSync <- true |
| 58 | }() |
| 59 | |
| 60 | runSync <- true |
| 61 | <-runSync |
| 62 | if !ok { |
| 63 | t.Error("shold not block") |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | func TestPublisher_serve(t *testing.T) { |
| 68 | var ( |
nothing calls this directly
no test coverage detected