(t *testing.T)
| 2119 | } |
| 2120 | |
| 2121 | func TestParseMultiIntSliceFromEnv(t *testing.T) { |
| 2122 | t.Setenv("APP_INTERVALS", "20,30,40") |
| 2123 | |
| 2124 | _ = (&Command{ |
| 2125 | Flags: []Flag{ |
| 2126 | &Int64SliceFlag{Name: "intervals", Aliases: []string{"i"}, Value: []int64{}, Sources: EnvVars("APP_INTERVALS")}, |
| 2127 | }, |
| 2128 | Action: func(_ context.Context, cmd *Command) error { |
| 2129 | r := require.New(t) |
| 2130 | |
| 2131 | r.Equalf([]int64{20, 30, 40}, cmd.Int64Slice("intervals"), "main name not set from env") |
| 2132 | r.Equalf([]int64{20, 30, 40}, cmd.Int64Slice("i"), "short name not set from env") |
| 2133 | |
| 2134 | return nil |
| 2135 | }, |
| 2136 | }).Run(buildTestContext(t), []string{"run"}) |
| 2137 | } |
| 2138 | |
| 2139 | func TestParseMultiIntSliceFromEnvWithDefaults(t *testing.T) { |
| 2140 | t.Setenv("APP_INTERVALS", "20,30,40") |
nothing calls this directly
no test coverage detected