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

Function TestIntSliceFlagWithEnvVarHelpOutput

flag_test.go:1073–1085  ·  flag_test.go::TestIntSliceFlagWithEnvVarHelpOutput
(t *testing.T)

Source from the content-addressed store, hash-verified

1071}
1072
1073func TestIntSliceFlagWithEnvVarHelpOutput(t *testing.T) {
1074 t.Setenv("APP_SMURF", "42,3")
1075
1076 for _, test := range intSliceFlagTests {
1077 fl := &Int64SliceFlag{Name: test.name, Aliases: test.aliases, Value: test.value, Sources: EnvVars("APP_SMURF")}
1078 output := fl.String()
1079
1080 expectedSuffix := withEnvHint([]string{"APP_SMURF"}, "")
1081 if !strings.HasSuffix(output, expectedSuffix) {
1082 t.Errorf("%q does not end with"+expectedSuffix, output)
1083 }
1084 }
1085}
1086
1087func TestIntSliceFlagApply_SetsAllNames(t *testing.T) {
1088 fl := &Int64SliceFlag{Name: "bits", Aliases: []string{"B", "bips"}}

Callers

nothing calls this directly

Calls 3

EnvVarsFunction · 0.85
withEnvHintFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected