Example #1
0
// 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))
	}
}
Example #2
0
// 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))
	}
}