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

Function TestGenericFlagWithEnvVarHelpOutput

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

Source from the content-addressed store, hash-verified

1666}
1667
1668func TestGenericFlagWithEnvVarHelpOutput(t *testing.T) {
1669 t.Setenv("APP_ZAP", "3")
1670
1671 for _, test := range genericFlagTests {
1672 fl := &GenericFlag{Name: test.name, Sources: EnvVars("APP_ZAP")}
1673 output := fl.String()
1674
1675 expectedSuffix := withEnvHint([]string{"APP_ZAP"}, "")
1676 if !strings.HasSuffix(output, expectedSuffix) {
1677 t.Errorf("%s does not end with"+expectedSuffix, output)
1678 }
1679 }
1680}
1681
1682func TestGenericFlagApply_SetsAllNames(t *testing.T) {
1683 fl := GenericFlag{Name: "orbs", Aliases: []string{"O", "obrs"}, Value: &Parser{}}

Callers

nothing calls this directly

Calls 3

EnvVarsFunction · 0.85
withEnvHintFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected