TestCustomFormat update
Vladimir Bauer
9 years ago
| 150 | 150 | func TestCustomFormat(t *testing.T) { |
| 151 | 151 | var buf bytes.Buffer |
| 152 | 152 | cancel := make(chan struct{}) |
| 153 | shutdown := make(chan struct{}) | |
| 154 | 153 | customFormat := "╢▌▌░╟" |
| 155 | 154 | p := mpb.New().Format(customFormat). |
| 156 | 155 | WithCancel(cancel). |
| 157 | ShutdownNotify(shutdown). | |
| 158 | 156 | SetOut(&buf) |
| 159 | 157 | bar := p.AddBar(100).TrimLeftSpace().TrimRightSpace() |
| 160 | 158 | |
| 165 | 163 | } |
| 166 | 164 | }() |
| 167 | 165 | |
| 168 | time.Sleep(300 * time.Millisecond) | |
| 166 | time.Sleep(250 * time.Millisecond) | |
| 169 | 167 | close(cancel) |
| 170 | 168 | p.Stop() |
| 171 | 169 | |