Codebase list golang-github-vbauerster-mpb / b0dd0e8
refactoring draw test Vladimir Bauer 6 years ago
1 changed file(s) with 14 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
1414 barWidth int
1515 trimSpace bool
1616 reverse bool
17 rup int64
17 refill int64
1818 want string
1919 }{
2020 0: {
231231 want: "[------------------------------------------------------------------<===============================]",
232232 },
233233 {
234 name: "t,c,rup{100,33,33}",
234 name: "t,c,refill{100,33,33}",
235235 total: 100,
236236 current: 33,
237 rup: 33,
237 refill: 33,
238238 want: " [+++++++++++++++++++++++++++++++>----------------------------------------------------------------] ",
239239 },
240240 {
241 name: "t,c,rup{100,33,33}trim",
241 name: "t,c,refill{100,33,33}trim",
242242 total: 100,
243243 current: 33,
244 rup: 33,
244 refill: 33,
245245 trimSpace: true,
246246 want: "[+++++++++++++++++++++++++++++++>------------------------------------------------------------------]",
247247 },
248248 {
249 name: "t,c,rup{100,33,33}trim,rev",
249 name: "t,c,refill{100,33,33}trim,rev",
250250 total: 100,
251251 current: 33,
252 rup: 33,
252 refill: 33,
253253 trimSpace: true,
254254 reverse: true,
255255 want: "[------------------------------------------------------------------<+++++++++++++++++++++++++++++++]",
256256 },
257257 {
258 name: "t,c,rup{100,40,33}",
258 name: "t,c,refill{100,40,33}",
259259 total: 100,
260260 current: 40,
261 rup: 33,
261 refill: 33,
262262 want: " [++++++++++++++++++++++++++++++++=====>----------------------------------------------------------] ",
263263 },
264264 {
265 name: "t,c,rup{100,40,33}trim",
265 name: "t,c,refill{100,40,33}trim",
266266 total: 100,
267267 current: 40,
268 rup: 33,
268 refill: 33,
269269 trimSpace: true,
270270 want: "[++++++++++++++++++++++++++++++++======>-----------------------------------------------------------]",
271271 },
296296 want: "[==================================================================================================]",
297297 },
298298 {
299 name: "[=の-] t,c{100,100}",
299 name: "[=の-] t,c{100,1}",
300300 style: "[=の-]",
301301 total: 100,
302302 current: 1,
313313 s.total = tc.total
314314 s.current = tc.current
315315 s.trimSpace = tc.trimSpace
316 if tc.rup > 0 {
316 if tc.refill > 0 {
317317 if f, ok := s.filler.(interface{ SetRefill(int64) }); ok {
318 f.SetRefill(tc.rup)
318 f.SetRefill(tc.refill)
319319 }
320320 }
321321 tmpBuf.Reset()