refactoring: TestMaxWidthDistributor
Vladimir Bauer
3 years ago
| 111 | 111 | } |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | // MaxWidthDistributor shouldn't stuck in the middle while removing or aborting a bar | |
| 115 | 114 | func TestMaxWidthDistributor(t *testing.T) { |
| 116 | ||
| 117 | 115 | makeWrapper := func(f func([]chan int), start, end chan struct{}) func([]chan int) { |
| 118 | 116 | return func(column []chan int) { |
| 119 | 117 | start <- struct{}{} |
| 125 | 123 | ready := make(chan struct{}) |
| 126 | 124 | start := make(chan struct{}) |
| 127 | 125 | end := make(chan struct{}) |
| 126 | // mpb.MaxWidthDistributor shouldn't stuck in the middle while removing or aborting a bar | |
| 128 | 127 | mpb.MaxWidthDistributor = makeWrapper(mpb.MaxWidthDistributor, start, end) |
| 129 | 128 | |
| 130 | 129 | total := 100 |