(t *testing.T)
| 2045 | } |
| 2046 | |
| 2047 | func TestParseMultiIntFromEnv(t *testing.T) { |
| 2048 | t.Setenv("APP_TIMEOUT_SECONDS", "10") |
| 2049 | _ = (&Command{ |
| 2050 | Flags: []Flag{ |
| 2051 | &Int64Flag{Name: "timeout", Aliases: []string{"t"}, Sources: EnvVars("APP_TIMEOUT_SECONDS")}, |
| 2052 | }, |
| 2053 | Action: func(_ context.Context, cmd *Command) error { |
| 2054 | assert.Equal(t, int64(10), cmd.Int64("timeout"), "main name not set") |
| 2055 | assert.Equal(t, int64(10), cmd.Int64("t"), "short name not set") |
| 2056 | return nil |
| 2057 | }, |
| 2058 | }).Run(buildTestContext(t), []string{"run"}) |
| 2059 | } |
| 2060 | |
| 2061 | func TestParseMultiIntFromEnvCascade(t *testing.T) { |
| 2062 | t.Setenv("APP_TIMEOUT_SECONDS", "10") |
nothing calls this directly
no test coverage detected