Codebase list golang-github-vbauerster-mpb / 79b6acf
bar test update Vladimir Bauer 9 years ago
1 changed file(s) with 19 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
1212 want []byte
1313 }{
1414 {
15 termWidth: 2,
15 termWidth: 1,
1616 barWidth: 60,
1717 want: []byte{},
1818 },
1919 {
20 termWidth: 3,
20 termWidth: 2,
2121 barWidth: 60,
2222 want: []byte("[]"),
2323 },
2424 {
2525 termWidth: 4,
2626 barWidth: 60,
27 want: []byte("[>]"),
28 },
29 {
30 termWidth: 5,
31 barWidth: 60,
3227 want: []byte("[=>]"),
3328 },
3429 {
3530 termWidth: 6,
3631 barWidth: 60,
37 want: []byte("[=>-]"),
32 want: []byte("[==>-]"),
33 },
34 {
35 termWidth: 8,
36 barWidth: 60,
37 want: []byte("[====>-]"),
38 },
39 {
40 termWidth: 80,
41 barWidth: 60,
42 want: []byte("[===========================================>--------------]"),
43 },
44 {
45 termWidth: 80,
46 barWidth: 62,
47 want: []byte("[============================================>---------------]"),
3848 },
3949 }
4050
4959
5060 func newTestState(total, current int64) *state {
5161 return &state{
52 fill: '=',
53 empty: '-',
54 tip: '>',
55 leftEnd: '[',
56 rightEnd: ']',
62 format: formatRunes{'[', '=', '>', '-', ']'},
5763 total: total,
5864 current: current,
5965 trimLeftSpace: true,