Codebase list golang-github-vbauerster-mpb / 252bfb7
TestNoOutput Vladimir Bauer 3 years ago
1 changed file(s) with 18 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
243243 t.Errorf("Expected bar a, got: %s", identity[bar])
244244 }
245245 }
246
247 func TestNoOutput(t *testing.T) {
248 var buf bytes.Buffer
249 p := mpb.New(mpb.WithOutput(&buf))
250 bar := p.AddBar(100)
251
252 go func() {
253 for !bar.Completed() {
254 bar.Increment()
255 }
256 }()
257
258 p.Wait()
259
260 if buf.Len() != 0 {
261 t.Errorf("Expected buf.Len == 0, got: %d\n", buf.Len())
262 }
263 }