(t *testing.T)
| 60 | } |
| 61 | |
| 62 | func TestGetBestFoo2(t *testing.T) { |
| 63 | mock := publisherMock2{ |
| 64 | ch: make(chan []Foo), |
| 65 | } |
| 66 | defer close(mock.ch) |
| 67 | |
| 68 | h := Handler{ |
| 69 | publisher: &mock, |
| 70 | n: 2, |
| 71 | } |
| 72 | foo := h.getBestFoo(42) |
| 73 | // Check foo |
| 74 | _ = foo |
| 75 | |
| 76 | if v := len(<-mock.ch); v != 2 { |
| 77 | t.Fatalf("expected 2, got %d", v) |
| 78 | } |
| 79 | } |
nothing calls this directly
no test coverage detected