Codebase list golang-github-vbauerster-mpb / d54fb86
refactoring: TestBarCount Vladimir Bauer 3 years ago
1 changed file(s) with 2 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
2222 }
2323
2424 func TestBarCount(t *testing.T) {
25 shutdown := make(chan struct{})
26 p := mpb.New(mpb.WithShutdownNotifier(shutdown), mpb.WithOutput(io.Discard))
25 p := mpb.New(mpb.WithOutput(io.Discard))
2726
2827 b := p.AddBar(0, mpb.BarRemoveOnComplete())
2928
3938 t.Errorf("BarCount want: %d, got: %d\n", 0, count)
4039 }
4140
42 go p.Wait()
43
44 select {
45 case <-shutdown:
46 case <-time.After(timeout):
47 t.Errorf("Progress didn't shutdown after %v", timeout)
48 }
41 p.Wait()
4942 }
5043
5144 func TestBarAbort(t *testing.T) {