Codebase list golang-github-vbauerster-mpb / 17d02fb
TestCustomFormat update Vladimir Bauer 9 years ago
1 changed file(s) with 1 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
150150 func TestCustomFormat(t *testing.T) {
151151 var buf bytes.Buffer
152152 cancel := make(chan struct{})
153 shutdown := make(chan struct{})
154153 customFormat := "╢▌▌░╟"
155154 p := mpb.New().Format(customFormat).
156155 WithCancel(cancel).
157 ShutdownNotify(shutdown).
158156 SetOut(&buf)
159157 bar := p.AddBar(100).TrimLeftSpace().TrimRightSpace()
160158
165163 }
166164 }()
167165
168 time.Sleep(300 * time.Millisecond)
166 time.Sleep(250 * time.Millisecond)
169167 close(cancel)
170168 p.Stop()
171169