diff --git a/bar_test.go b/bar_test.go index 0129b93..78cedd7 100644 --- a/bar_test.go +++ b/bar_test.go @@ -15,7 +15,7 @@ ) func TestBarCompleted(t *testing.T) { - p := New(WithOutput(ioutil.Discard)) + p := New(WithWidth(80), WithOutput(ioutil.Discard)) total := 80 bar := p.AddBar(int64(total)) @@ -33,7 +33,7 @@ } func TestBarID(t *testing.T) { - p := New(WithOutput(ioutil.Discard)) + p := New(WithWidth(80), WithOutput(ioutil.Discard)) total := 100 wantID := 11 bar := p.AddBar(int64(total), BarID(wantID)) @@ -57,8 +57,7 @@ func TestBarSetRefill(t *testing.T) { var buf bytes.Buffer - width := 100 - p := New(WithOutput(&buf), WithWidth(width)) + p := New(WithOutput(&buf), WithWidth(100)) total := 100 till := 30 @@ -91,7 +90,7 @@ func TestBarHas100PercentWithOnCompleteDecorator(t *testing.T) { var buf bytes.Buffer - p := New(WithOutput(&buf), WithWidth(80)) + p := New(WithWidth(80), WithOutput(&buf)) total := 50 @@ -119,7 +118,7 @@ func TestBarHas100PercentWithBarRemoveOnComplete(t *testing.T) { var buf bytes.Buffer - p := New(WithOutput(&buf), WithWidth(80)) + p := New(WithWidth(80), WithOutput(&buf)) total := 50 @@ -145,7 +144,7 @@ var buf bytes.Buffer customFormat := "╢▌▌░╟" total := 80 - p := New(WithOutput(&buf), WithWidth(total)) + p := New(WithWidth(total), WithOutput(&buf)) bar := p.AddBar(int64(total), BarStyle(customFormat), TrimSpace()) for i := 0; i < total; i++ { @@ -171,9 +170,9 @@ func TestBarPanicBeforeComplete(t *testing.T) { var buf bytes.Buffer p := New( + WithWidth(80), WithDebugOutput(&buf), WithOutput(ioutil.Discard), - WithWidth(80), ) total := 100 @@ -211,9 +210,9 @@ func TestBarPanicAfterComplete(t *testing.T) { var buf bytes.Buffer p := New( + WithWidth(80), WithDebugOutput(&buf), WithOutput(ioutil.Discard), - WithWidth(80), ) total := 100