From 0c206f707c7319c64919dfa91f30b02720a4142e Mon Sep 17 00:00:00 2001 From: Naveen Gogineni Date: Wed, 6 Nov 2024 19:19:16 -0500 Subject: [PATCH] Add more tests --- flag_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flag_test.go b/flag_test.go index 9fe57cacdc..6427c1af09 100644 --- a/flag_test.go +++ b/flag_test.go @@ -1625,6 +1625,7 @@ func TestGenericFlagValueFromCommand(t *testing.T) { assert.NoError(t, cmd.Run(buildTestContext(t), []string{"foo", "--myflag", "abc,def"})) assert.Equal(t, &Parser{"abc", "def"}, cmd.Generic("myflag")) + assert.Nil(t, cmd.Generic("someother")) } func TestParseGenericFromEnv(t *testing.T) { @@ -3267,3 +3268,10 @@ func TestGenericFlag_SatisfiesDocFlagInterface(t *testing.T) { _ = f.GetUsage() } + +func TestGenericValue(t *testing.T) { + g := &genericValue{} + assert.NoError(t, g.Set("something")) + assert.Nil(t, g.Get()) + assert.Empty(t, g.String()) +}