(t *testing.T)
| 17 | } |
| 18 | |
| 19 | func TestListQueue(t *testing.T) { |
| 20 | q := NewListQueue(2) |
| 21 | q.Run() |
| 22 | |
| 23 | var data int64 |
| 24 | q.Push(&testJob{ |
| 25 | payload: 0, |
| 26 | callback: func(result int) { |
| 27 | atomic.AddInt64(&data, int64(result)) |
| 28 | }, |
| 29 | }) |
| 30 | q.Push(&testJob{ |
| 31 | payload: 0, |
| 32 | callback: func(result int) { |
| 33 | atomic.AddInt64(&data, int64(result)) |
| 34 | }, |
| 35 | }) |
| 36 | q.Push(&testJob{ |
| 37 | payload: 0, |
| 38 | callback: func(result int) { |
| 39 | atomic.AddInt64(&data, int64(result)) |
| 40 | }, |
| 41 | }) |
| 42 | q.Terminate() |
| 43 | if data != 3 { |
| 44 | t.Error(data) |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | func ExampleListQueue() { |
| 49 | q := NewListQueue(10) |
nothing calls this directly
no test coverage detected