// TestSilenceOff func TestSilenceOff(t *testing.T) { config.Silent = false out := stdoutToString(func() { printutil.Silence("test silence output") }) if out != "test silence output" { t.Error(fmt.Sprintf("Expected 'test silence output' got '%s'", out)) } }
// TestSilenceOn func TestSilenceOn(t *testing.T) { config.Silent = true out := stdoutToString(func() { printutil.Silence("test silence output") }) if out != "" { t.Error(fmt.Sprintf("Expected nothing got '%s'", out)) } }