Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Nov 7, 2024
1 parent cd719c0 commit 0c206f7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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())
}

0 comments on commit 0c206f7

Please sign in to comment.