Codebase list golang-github-vbauerster-mpb / a2dcb28
minor: prefer t.Error Vladimir Bauer 1 year, 10 months ago
1 changed file(s) with 10 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
1919 bar := p.AddBar(int64(total))
2020
2121 if bar.Completed() {
22 t.Fail()
22 t.Error("expected bar not to complete")
2323 }
2424
2525 bar.IncrBy(total)
2626
2727 if !bar.Completed() {
28 t.Error("bar isn't completed after increment")
28 t.Error("expected bar to complete")
2929 }
3030
3131 p.Wait()
3737 bar := p.AddBar(int64(total))
3838
3939 if bar.Aborted() {
40 t.Fail()
40 t.Error("expected bar not to be aborted")
4141 }
4242
4343 bar.Abort(false)
4444
4545 if !bar.Aborted() {
46 t.Error("bar isn't aborted after abort call")
46 t.Error("expected bar to be aborted")
4747 }
4848
4949 p.Wait()
7171 bar := p.AddBar(0) // never complete bar
7272
7373 if bar.Completed() {
74 t.Fail()
74 t.Error("expected bar not to complete")
7575 }
7676
7777 // Calling bar.SetTotal(0, true) has same effect
7979 bar.EnableTriggerComplete()
8080
8181 if !bar.Completed() {
82 t.Fail()
82 t.Error("expected bar to complete")
8383 }
8484
8585 p.Wait()
9999 } {
100100 f()
101101 if bar.Completed() {
102 t.Fail()
102 t.Error("expected bar not to complete")
103103 }
104104 }
105105
106106 bar.EnableTriggerComplete()
107107
108108 if !bar.Completed() {
109 t.Fail()
109 t.Error("expected bar to complete")
110110 }
111111
112112 if current := bar.Current(); current != targetTotal {
131131 } {
132132 f()
133133 if bar.Completed() {
134 t.Fail()
134 t.Error("expected bar not to complete")
135135 }
136136 }
137137
138138 bar.IncrBy(20)
139139
140140 if !bar.Completed() {
141 t.Fail()
141 t.Error("expected bar to complete")
142142 }
143143
144144 if current := bar.Current(); current != targetTotal {