Codebase list golang-github-vbauerster-mpb / 2ab12c8
simplify TestBarCompleted Vladimir Bauer 4 years ago
1 changed file(s) with 9 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
1818 total := 80
1919 bar := p.AddBar(int64(total))
2020
21 var count int
22 for !bar.Completed() {
23 time.Sleep(10 * time.Millisecond)
24 bar.Increment()
25 count++
26 }
27
28 p.Wait()
29 if count != total {
30 t.Errorf("got count: %d, expected %d\n", count, total)
31 }
21 for i := 0; i < total; i++ {
22 bar.Increment()
23 }
24
25 if !bar.Completed() {
26 t.Error("bar isn't completed")
27 }
28
29 p.Wait()
3230 }
3331
3432 func TestBarID(t *testing.T) {