(t *testing.T)
| 2201 | } |
| 2202 | |
| 2203 | func TestParseMultiFloat64FromEnv(t *testing.T) { |
| 2204 | t.Setenv("APP_TIMEOUT_SECONDS", "15.5") |
| 2205 | _ = (&Command{ |
| 2206 | Flags: []Flag{ |
| 2207 | &FloatFlag{Name: "timeout", Aliases: []string{"t"}, Sources: EnvVars("APP_TIMEOUT_SECONDS")}, |
| 2208 | }, |
| 2209 | Action: func(_ context.Context, cmd *Command) error { |
| 2210 | assert.Equal(t, 15.5, cmd.Float("timeout"), "main name not set") |
| 2211 | assert.Equal(t, 15.5, cmd.Float("t"), "short name not set") |
| 2212 | return nil |
| 2213 | }, |
| 2214 | }).Run(buildTestContext(t), []string{"run"}) |
| 2215 | } |
| 2216 | |
| 2217 | func TestParseMultiFloat64FromEnvCascade(t *testing.T) { |
| 2218 | t.Setenv("APP_TIMEOUT_SECONDS", "15.5") |
nothing calls this directly
no test coverage detected