From 5090305bcbfacb80693f5db617b7dfca1b7a27d7 Mon Sep 17 00:00:00 2001 From: Connor Hindley Date: Wed, 17 Nov 2021 11:44:13 -0700 Subject: [PATCH] Add help testcase for envprefix + no env. --- help_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/help_test.go b/help_test.go index 875ca1b..d907cc8 100644 --- a/help_test.go +++ b/help_test.go @@ -463,7 +463,8 @@ func TestEnvarAutoHelp(t *testing.T) { func TestEnvarAutoHelpWithEnvPrefix(t *testing.T) { type Anonymous struct { - Flag string `env:"FLAG" help:"A flag."` + Flag string `env:"FLAG" help:"A flag."` + Other string `help:"A different flag."` } var cli struct { Anonymous `envprefix:"ANON_"` @@ -473,6 +474,7 @@ func TestEnvarAutoHelpWithEnvPrefix(t *testing.T) { _, err := p.Parse([]string{"--help"}) require.NoError(t, err) require.Contains(t, w.String(), "A flag ($ANON_FLAG).") + require.Contains(t, w.String(), "A different flag.") } func TestCustomHelpFormatter(t *testing.T) {