diff --git a/bar_test.go b/bar_test.go index b86fcad..4b474f3 100644 --- a/bar_test.go +++ b/bar_test.go @@ -29,6 +29,24 @@ if !bar.Completed() { t.Error("bar isn't completed after increment") + } + + p.Wait() +} + +func TestBarAborted(t *testing.T) { + p := mpb.New(mpb.WithWidth(80), mpb.WithOutput(ioutil.Discard)) + total := 80 + bar := p.AddBar(int64(total)) + + if bar.Aborted() { + t.Fail() + } + + bar.Abort(false) + + if !bar.Aborted() { + t.Error("bar isn't aborted after abort call") } p.Wait()