(t *testing.T)
| 2073 | } |
| 2074 | |
| 2075 | func TestParseMultiIntSlice(t *testing.T) { |
| 2076 | _ = (&Command{ |
| 2077 | Flags: []Flag{ |
| 2078 | &Int64SliceFlag{Name: "serve", Aliases: []string{"s"}, Value: []int64{}}, |
| 2079 | }, |
| 2080 | Action: func(_ context.Context, cmd *Command) error { |
| 2081 | r := require.New(t) |
| 2082 | |
| 2083 | r.Equalf([]int64{10, 20}, cmd.Int64Slice("serve"), "main name not set") |
| 2084 | r.Equalf([]int64{10, 20}, cmd.Int64Slice("s"), "short name not set") |
| 2085 | |
| 2086 | return nil |
| 2087 | }, |
| 2088 | }).Run(buildTestContext(t), []string{"run", "-s", "10", "-s", "20"}) |
| 2089 | } |
| 2090 | |
| 2091 | func TestParseMultiIntSliceWithDefaults(t *testing.T) { |
| 2092 | _ = (&Command{ |
nothing calls this directly
no test coverage detected