(t *testing.T)
| 2059 | } |
| 2060 | |
| 2061 | func TestParseMultiIntFromEnvCascade(t *testing.T) { |
| 2062 | t.Setenv("APP_TIMEOUT_SECONDS", "10") |
| 2063 | _ = (&Command{ |
| 2064 | Flags: []Flag{ |
| 2065 | &Int64Flag{Name: "timeout", Aliases: []string{"t"}, Sources: EnvVars("COMPAT_TIMEOUT_SECONDS", "APP_TIMEOUT_SECONDS")}, |
| 2066 | }, |
| 2067 | Action: func(_ context.Context, cmd *Command) error { |
| 2068 | assert.Equal(t, int64(10), cmd.Int64("timeout"), "main name not set") |
| 2069 | assert.Equal(t, int64(10), cmd.Int64("t"), "short name not set") |
| 2070 | return nil |
| 2071 | }, |
| 2072 | }).Run(buildTestContext(t), []string{"run"}) |
| 2073 | } |
| 2074 | |
| 2075 | func TestParseMultiIntSlice(t *testing.T) { |
| 2076 | _ = (&Command{ |
nothing calls this directly
no test coverage detected