(t *testing.T)
| 1985 | } |
| 1986 | |
| 1987 | func TestParseMultiStringSliceFromEnvCascadeWithDefaults(t *testing.T) { |
| 1988 | t.Setenv("APP_INTERVALS", "20,30,40") |
| 1989 | |
| 1990 | _ = (&Command{ |
| 1991 | Flags: []Flag{ |
| 1992 | &StringSliceFlag{Name: "intervals", Aliases: []string{"i"}, Value: []string{"1", "2", "5"}, Sources: EnvVars("COMPAT_INTERVALS", "APP_INTERVALS")}, |
| 1993 | }, |
| 1994 | Action: func(_ context.Context, cmd *Command) error { |
| 1995 | expected := []string{"20", "30", "40"} |
| 1996 | assert.Equal(t, expected, cmd.StringSlice("intervals"), "main name not set from env") |
| 1997 | assert.Equal(t, expected, cmd.StringSlice("i"), "short name not set from env") |
| 1998 | return nil |
| 1999 | }, |
| 2000 | }).Run(buildTestContext(t), []string{"run"}) |
| 2001 | } |
| 2002 | |
| 2003 | func TestParseMultiStringSliceFromEnvWithDestination(t *testing.T) { |
| 2004 | t.Setenv("APP_INTERVALS", "20,30,40") |
nothing calls this directly
no test coverage detected