MCPcopy
hub / github.com/urfave/cli / TestParseMultiIntFromEnvCascade

Function TestParseMultiIntFromEnvCascade

flag_test.go:2061–2073  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2059}
2060
2061func 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
2075func TestParseMultiIntSlice(t *testing.T) {
2076 _ = (&Command{

Callers

nothing calls this directly

Calls 4

EnvVarsFunction · 0.85
buildTestContextFunction · 0.85
Int64Method · 0.80
RunMethod · 0.45

Tested by

no test coverage detected