Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2375,6 +2375,22 @@ func TestParseMultiBoolT(t *testing.T) {
}).Run(buildTestContext(t), []string{"run", "--implode=false"})
}

func TestStringSliceFlagApply_LocalPreservesRepeatedValues(t *testing.T) {
var got []string
cmd := &Command{
Flags: []Flag{
&StringSliceFlag{Name: "values", Local: true},
},
Action: func(_ context.Context, cmd *Command) error {
got = cmd.StringSlice("values")
return nil
},
}

require.NoError(t, cmd.Run(buildTestContext(t), []string{"run", "--values", "a,b,c", "--values", "d", "--values", "e"}))
require.Equal(t, []string{"a", "b", "c", "d", "e"}, got)
}

func TestStringSlice_Serialized_Set(t *testing.T) {
sl0 := NewStringSlice("a", "b")
ser0 := sl0.Serialize()
Expand Down
Loading