Skip to content

Commit

Permalink
Add more generic value tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Nov 8, 2024
1 parent 886ee6c commit b9f05fb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3245,6 +3245,24 @@ func TestGenericFlag_SatisfiesFlagInterface(t *testing.T) {
_ = f.Names()
}

func TestGenericValue_SatisfiesBoolInterface(t *testing.T) {
var f boolFlag = &genericValue{}

assert.False(t, f.IsBoolFlag())

fv := floatValue(0)
f = &genericValue{
val: &fv,
}

assert.False(t, f.IsBoolFlag())

f = &genericValue{
val: &boolValue{},
}
assert.True(t, f.IsBoolFlag())
}

func TestGenericFlag_SatisfiesFmtStringerInterface(t *testing.T) {
var f fmt.Stringer = &GenericFlag{}

Expand Down

0 comments on commit b9f05fb

Please sign in to comment.