Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dearchap committed Jan 22, 2023
1 parent 9d56eb7 commit b8d3bbe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions altsrc/flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,18 @@ func TestFloat64SliceFlagApplyInputSourceValueNotSet(t *testing.T) {
expect(t, dest.Value(), []float64{})
}

func TestFloat64SliceFlagApplyInputSourceValueInvalidType(t *testing.T) {
dest := cli.NewFloat64Slice()
tis := testApplyInputSource{
Flag: NewFloat64SliceFlag(&cli.Float64SliceFlag{Name: "test", Destination: dest}),
FlagName: "test",
MapValue: []interface{}{1, 2},
}
c := runTest(t, tis)
expect(t, c.Float64Slice("test"), []float64{})
expect(t, dest.Value(), []float64{})
}

func TestBoolApplyInputSourceMethodSet(t *testing.T) {
tis := testApplyInputSource{
Flag: NewBoolFlag(&cli.BoolFlag{Name: "test"}),
Expand Down

0 comments on commit b8d3bbe

Please sign in to comment.