(t *testing.T)
| 2089 | } |
| 2090 | |
| 2091 | func TestParseMultiIntSliceWithDefaults(t *testing.T) { |
| 2092 | _ = (&Command{ |
| 2093 | Flags: []Flag{ |
| 2094 | &Int64SliceFlag{Name: "serve", Aliases: []string{"s"}, Value: []int64{9, 2}}, |
| 2095 | }, |
| 2096 | Action: func(_ context.Context, cmd *Command) error { |
| 2097 | r := require.New(t) |
| 2098 | |
| 2099 | r.Equalf([]int64{10, 20}, cmd.Int64Slice("serve"), "main name not set") |
| 2100 | r.Equalf([]int64{10, 20}, cmd.Int64Slice("s"), "short name not set") |
| 2101 | |
| 2102 | return nil |
| 2103 | }, |
| 2104 | }).Run(buildTestContext(t), []string{"run", "-s", "10", "-s", "20"}) |
| 2105 | } |
| 2106 | |
| 2107 | func TestParseMultiIntSliceWithDefaultsUnset(t *testing.T) { |
| 2108 | _ = (&Command{ |
nothing calls this directly
no test coverage detected