File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ func (p *Printer) Error(msg string, args ...any) {
136136// Returns ErrAborted if the user answers negative.
137137func (p * Printer ) PromptForConfirmation (prompt string ) error {
138138 if p .AssumeYes {
139- p .Warn ("Auto-confirming prompt: %q" , prompt )
139+ p .Warn ("Auto-confirming prompt: %q\n " , prompt )
140140 return nil
141141 }
142142 question := fmt .Sprintf ("%s [y/N] " , prompt )
Original file line number Diff line number Diff line change @@ -509,6 +509,7 @@ func TestPromptForConfirmation(t *testing.T) {
509509 verbosity Level
510510 isValid bool
511511 isAborted bool
512+ assumeYes bool
512513 }{
513514 // Note: Some of these inputs have normal spaces, others have tabs
514515 {
@@ -647,6 +648,13 @@ func TestPromptForConfirmation(t *testing.T) {
647648 verbosity : DebugLevel ,
648649 isValid : false ,
649650 },
651+ {
652+ description : "no input with assume yes" ,
653+ input : "" ,
654+ verbosity : DebugLevel ,
655+ isValid : true ,
656+ assumeYes : true ,
657+ },
650658 }
651659
652660 for _ , tt := range tests {
@@ -665,6 +673,7 @@ func TestPromptForConfirmation(t *testing.T) {
665673 p := & Printer {
666674 Cmd : cmd ,
667675 Verbosity : tt .verbosity ,
676+ AssumeYes : tt .assumeYes ,
668677 }
669678
670679 err = p .PromptForConfirmation ("" )
You can’t perform that action at this time.
0 commit comments