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

Function TestIntFlagWithEnvVarHelpOutput

flag_test.go:886–898  ·  flag_test.go::TestIntFlagWithEnvVarHelpOutput
(t *testing.T)

Source from the content-addressed store, hash-verified

884}
885
886func TestIntFlagWithEnvVarHelpOutput(t *testing.T) {
887 t.Setenv("APP_BAR", "2")
888
889 for _, test := range intFlagTests {
890 fl := &Int64Flag{Name: test.name, Sources: EnvVars("APP_BAR")}
891 output := fl.String()
892
893 expectedSuffix := withEnvHint([]string{"APP_BAR"}, "")
894 if !strings.HasSuffix(output, expectedSuffix) {
895 t.Errorf("%s does not end with"+expectedSuffix, output)
896 }
897 }
898}
899
900func TestIntFlagApply_SetsAllNames(t *testing.T) {
901 v := int64(3)

Callers

nothing calls this directly

Calls 3

EnvVarsFunction · 0.85
withEnvHintFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected