MCPcopy Create free account
hub / github.com/schollz/progressbar / TestOptionShowTotalFalseDeterminate

Function TestOptionShowTotalFalseDeterminate

progressbar_test.go:1119–1134  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1117}
1118
1119func TestOptionShowTotalFalseDeterminate(t *testing.T) {
1120 buf := strings.Builder{}
1121 bar := NewOptions64(
1122 100000000,
1123 OptionShowBytes(true),
1124 OptionShowCount(),
1125 OptionSetWidth(10),
1126 OptionShowTotalBytes(false),
1127 OptionSetWriter(&buf),
1128 )
1129
1130 bar.Add(10000)
1131 if !strings.Contains(buf.String(), "10 kB, ") {
1132 t.Errorf("wrong string: %s", buf.String())
1133 }
1134}
1135
1136func TestOptionShowTotalFalseIndeterminate(t *testing.T) {
1137 buf := strings.Builder{}

Callers

nothing calls this directly

Calls 8

NewOptions64Function · 0.85
OptionShowBytesFunction · 0.85
OptionShowCountFunction · 0.85
OptionSetWidthFunction · 0.85
OptionShowTotalBytesFunction · 0.85
OptionSetWriterFunction · 0.85
AddMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…