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

Function TestStringSliceFlagWithEnvVarHelpOutput

flag_test.go:787–799  ·  flag_test.go::TestStringSliceFlagWithEnvVarHelpOutput
(t *testing.T)

Source from the content-addressed store, hash-verified

785}
786
787func TestStringSliceFlagWithEnvVarHelpOutput(t *testing.T) {
788 t.Setenv("APP_QWWX", "11,4")
789
790 for _, test := range stringSliceFlagTests {
791 fl := &StringSliceFlag{Name: test.name, Aliases: test.aliases, Value: test.value, Sources: EnvVars("APP_QWWX")}
792 output := fl.String()
793
794 expectedSuffix := withEnvHint([]string{"APP_QWWX"}, "")
795 if !strings.HasSuffix(output, expectedSuffix) {
796 t.Errorf("%q does not end with"+expectedSuffix, output)
797 }
798 }
799}
800
801func TestStringSliceFlagApply_SetsAllNames(t *testing.T) {
802 fl := &StringSliceFlag{Name: "goat", Aliases: []string{"G", "gooots"}}

Callers

nothing calls this directly

Calls 3

EnvVarsFunction · 0.85
withEnvHintFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected