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

Function TestStringFlagWithEnvVarHelpOutput

flag_test.go:666–678  ·  flag_test.go::TestStringFlagWithEnvVarHelpOutput
(t *testing.T)

Source from the content-addressed store, hash-verified

664}
665
666func TestStringFlagWithEnvVarHelpOutput(t *testing.T) {
667 t.Setenv("APP_FOO", "derp")
668
669 for _, test := range stringFlagTests {
670 fl := &StringFlag{Name: test.name, Aliases: test.aliases, Value: test.value, Sources: EnvVars("APP_FOO")}
671 output := fl.String()
672
673 expectedSuffix := withEnvHint([]string{"APP_FOO"}, "")
674 if !strings.HasSuffix(output, expectedSuffix) {
675 t.Errorf("%s does not end with"+expectedSuffix, output)
676 }
677 }
678}
679
680var _ = []struct {
681 name string

Callers

nothing calls this directly

Calls 3

EnvVarsFunction · 0.85
withEnvHintFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected