(t *testing.T)
| 2376 | } |
| 2377 | |
| 2378 | func TestStringSliceFlagApply_LocalPreservesRepeatedValues(t *testing.T) { |
| 2379 | var got []string |
| 2380 | cmd := &Command{ |
| 2381 | Flags: []Flag{ |
| 2382 | &StringSliceFlag{Name: "values", Local: true}, |
| 2383 | }, |
| 2384 | Action: func(_ context.Context, cmd *Command) error { |
| 2385 | got = cmd.StringSlice("values") |
| 2386 | return nil |
| 2387 | }, |
| 2388 | } |
| 2389 | |
| 2390 | require.NoError(t, cmd.Run(buildTestContext(t), []string{"run", "--values", "a,b,c", "--values", "d", "--values", "e"})) |
| 2391 | require.Equal(t, []string{"a", "b", "c", "d", "e"}, got) |
| 2392 | } |
| 2393 | |
| 2394 | func TestStringSlice_Serialized_Set(t *testing.T) { |
| 2395 | sl0 := NewStringSlice("a", "b") |
nothing calls this directly
no test coverage detected