diff --git a/bar_test.go b/bar_test.go index 6a467f1..b8cd1d0 100644 --- a/bar_test.go +++ b/bar_test.go @@ -19,17 +19,15 @@ total := 80 bar := p.AddBar(int64(total)) - var count int - for !bar.Completed() { - time.Sleep(10 * time.Millisecond) - bar.Increment() - count++ - } - - p.Wait() - if count != total { - t.Errorf("got count: %d, expected %d\n", count, total) - } + for i := 0; i < total; i++ { + bar.Increment() + } + + if !bar.Completed() { + t.Error("bar isn't completed") + } + + p.Wait() } func TestBarID(t *testing.T) {