From 4642746656c3f45cd91ae59a27afa21f34ba9ecf Mon Sep 17 00:00:00 2001 From: Gerrit Date: Wed, 9 Oct 2024 15:25:05 +0200 Subject: [PATCH] One more test. --- pkg/genericcli/prompt_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/genericcli/prompt_test.go b/pkg/genericcli/prompt_test.go index f031741..6d27baf 100644 --- a/pkg/genericcli/prompt_test.go +++ b/pkg/genericcli/prompt_test.go @@ -40,6 +40,18 @@ func TestPromptCustom(t *testing.T) { }, want: "Do you get it? [Ack/nack] ", }, + { + name: "custom prompt config, default answer with empty input", + input: "\n", + c: &PromptConfig{ + Message: "Do you get it?", + ShowAnswers: true, + AcceptedAnswers: []string{"ack", "a"}, + DefaultAnswer: "ack", + No: "nack", + }, + want: "Do you get it? [Ack/nack] ", + }, { name: "custom prompt config, default is no answer", input: "ack\n",