simplify TestBarID
Vladimir Bauer
4 years ago
| 38 | 38 |
total := 100
|
| 39 | 39 |
wantID := 11
|
| 40 | 40 |
bar := p.AddBar(int64(total), mpb.BarID(wantID))
|
| 41 | |
|
| 42 | |
go func() {
|
| 43 | |
for i := 0; i < total; i++ {
|
| 44 | |
time.Sleep(50 * time.Millisecond)
|
| 45 | |
bar.Increment()
|
| 46 | |
}
|
| 47 | |
}()
|
| 48 | 41 |
|
| 49 | 42 |
gotID := bar.ID()
|
| 50 | 43 |
if gotID != wantID {
|