check both cases
Vladimir Bauer
4 years ago
| 18 | 18 | total := 80 |
| 19 | 19 | bar := p.AddBar(int64(total)) |
| 20 | 20 | |
| 21 | if bar.Completed() { | |
| 22 | t.Error("bar is completed before increment") | |
| 23 | } | |
| 24 | ||
| 21 | 25 | for i := 0; i < total; i++ { |
| 22 | 26 | bar.Increment() |
| 23 | 27 | } |
| 24 | 28 | |
| 25 | 29 | if !bar.Completed() { |
| 26 | t.Error("bar isn't completed") | |
| 30 | t.Error("bar isn't completed after increment") | |
| 27 | 31 | } |
| 28 | 32 | |
| 29 | 33 | p.Wait() |