(t *testing.T)
| 1937 | } |
| 1938 | |
| 1939 | func TestParseMultiStringSliceFromEnv(t *testing.T) { |
| 1940 | t.Setenv("APP_INTERVALS", "20,30,40") |
| 1941 | |
| 1942 | _ = (&Command{ |
| 1943 | Flags: []Flag{ |
| 1944 | &StringSliceFlag{Name: "intervals", Aliases: []string{"i"}, Value: []string{}, Sources: EnvVars("APP_INTERVALS")}, |
| 1945 | }, |
| 1946 | Action: func(_ context.Context, cmd *Command) error { |
| 1947 | expected := []string{"20", "30", "40"} |
| 1948 | assert.Equal(t, expected, cmd.StringSlice("intervals"), "main name not set from env") |
| 1949 | assert.Equal(t, expected, cmd.StringSlice("i"), "short name not set from env") |
| 1950 | return nil |
| 1951 | }, |
| 1952 | }).Run(buildTestContext(t), []string{"run"}) |
| 1953 | } |
| 1954 | |
| 1955 | func TestParseMultiStringSliceFromEnvWithDefaults(t *testing.T) { |
| 1956 | t.Setenv("APP_INTERVALS", "20,30,40") |
nothing calls this directly
no test coverage detected