(t *testing.T)
| 1969 | } |
| 1970 | |
| 1971 | func TestParseMultiStringSliceFromEnvCascade(t *testing.T) { |
| 1972 | t.Setenv("APP_INTERVALS", "20,30,40") |
| 1973 | |
| 1974 | _ = (&Command{ |
| 1975 | Flags: []Flag{ |
| 1976 | &StringSliceFlag{Name: "intervals", Aliases: []string{"i"}, Value: []string{}, Sources: EnvVars("COMPAT_INTERVALS", "APP_INTERVALS")}, |
| 1977 | }, |
| 1978 | Action: func(_ context.Context, cmd *Command) error { |
| 1979 | expected := []string{"20", "30", "40"} |
| 1980 | assert.Equal(t, expected, cmd.StringSlice("intervals"), "main name not set from env") |
| 1981 | assert.Equal(t, expected, cmd.StringSlice("i"), "short name not set from env") |
| 1982 | return nil |
| 1983 | }, |
| 1984 | }).Run(buildTestContext(t), []string{"run"}) |
| 1985 | } |
| 1986 | |
| 1987 | func TestParseMultiStringSliceFromEnvCascadeWithDefaults(t *testing.T) { |
| 1988 | t.Setenv("APP_INTERVALS", "20,30,40") |
nothing calls this directly
no test coverage detected