Skip to content

Commit 12ba16a

Browse files
committed
import virtualterm for testing.
update go version
1 parent 5ad50c6 commit 12ba16a

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

go.mod

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
module github.com/schollz/progressbar/v3
22

33
require (
4-
github.com/davecgh/go-spew v1.1.1 // indirect
54
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213
6-
github.com/mattn/go-isatty v0.0.20 // indirect
75
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db
86
github.com/rivo/uniseg v0.4.7
9-
github.com/stretchr/testify v1.3.0
7+
github.com/stretchr/testify v1.9.0
108
golang.org/x/term v0.24.0
119
)
1210

13-
go 1.13
11+
require (
12+
github.com/chengxilo/virtualterm v1.0.3 // indirect
13+
github.com/davecgh/go-spew v1.1.1 // indirect
14+
github.com/mattn/go-isatty v0.0.20 // indirect
15+
github.com/pmezard/go-difflib v1.0.0 // indirect
16+
golang.org/x/sys v0.25.0 // indirect
17+
gopkg.in/yaml.v3 v3.0.1 // indirect
18+
)
19+
20+
go 1.22

go.sum

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1+
github.com/chengxilo/virtualterm v1.0.3 h1:Vycm/mKGeHuLXA4zK3XsaseOW7VMY6jJ88/9+XHSNcA=
2+
github.com/chengxilo/virtualterm v1.0.3/go.mod h1:wjAbIDvnp6Vc8hQoM7tt6fcdk0NiSaQBSoSRwMIpphs=
23
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
34
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
45
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 h1:qGQQKEcAR99REcMpsXCp3lJ03zYT1PkRd3kQGPn9GVg=
@@ -11,11 +12,14 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
1112
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1213
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
1314
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
14-
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
15-
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
16-
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
15+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
16+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1717
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
1818
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
1919
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
2020
golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
2121
golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
22+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
23+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
24+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
25+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

progressbar_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"crypto/md5"
66
"encoding/hex"
77
"fmt"
8+
"github.com/chengxilo/virtualterm"
89
"io"
910
"net/http"
1011
"os"
@@ -101,10 +102,8 @@ func TestSpinnerClearOnFinish(t *testing.T) {
101102
bar.Add(10)
102103
time.Sleep(1 * time.Second)
103104
bar.Finish()
104-
result := buf.String()
105-
expect := "" +
106-
"\r- (10 B, 10 B/s, 10 it/s) [1s] " +
107-
"\r \r"
105+
result, _ := virtualterm.Process(buf.String())
106+
expect := " "
108107
if result != expect {
109108
t.Errorf("Render miss-match\nResult: '%s'\nExpect: '%s'\n%+v", result, expect, bar)
110109
}

0 commit comments

Comments
 (0)