diff --git a/progress_test.go b/progress_test.go index 57bdb7a..0afc835 100644 --- a/progress_test.go +++ b/progress_test.go @@ -244,3 +244,21 @@ t.Errorf("Expected bar a, got: %s", identity[bar]) } } + +func TestNoOutput(t *testing.T) { + var buf bytes.Buffer + p := mpb.New(mpb.WithOutput(&buf)) + bar := p.AddBar(100) + + go func() { + for !bar.Completed() { + bar.Increment() + } + }() + + p.Wait() + + if buf.Len() != 0 { + t.Errorf("Expected buf.Len == 0, got: %d\n", buf.Len()) + } +}