MCPcopy Index your code
hub / github.com/schollz/progressbar / TestBasicSets

Function TestBasicSets

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

Source from the content-addressed store, hash-verified

438}
439
440func TestBasicSets(t *testing.T) {
441 b := NewOptions(
442 999,
443 OptionSetWidth(888),
444 OptionSetRenderBlankState(true),
445 OptionSetWriter(io.Discard), // suppressing output for this test
446 )
447
448 tc := b.config
449
450 if tc.max != 999 {
451 t.Errorf("Expected %s to be %d, instead I got %d\n%+v", "max", 999, tc.max, b)
452 }
453
454 if tc.width != 888 {
455 t.Errorf("Expected %s to be %d, instead I got %d\n%+v", "width", 999, tc.max, b)
456 }
457
458 if !tc.renderWithBlankState {
459 t.Errorf("Expected %s to be %t, instead I got %t\n%+v", "renderWithBlankState", true, tc.renderWithBlankState, b)
460 }
461}
462
463func TestOptionSetTheme(t *testing.T) {
464 buf := strings.Builder{}

Callers

nothing calls this directly

Calls 4

NewOptionsFunction · 0.85
OptionSetWidthFunction · 0.85
OptionSetWriterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…