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

Function TestUintFlagWithEnvVarHelpOutput

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

Source from the content-addressed store, hash-verified

936}
937
938func TestUintFlagWithEnvVarHelpOutput(t *testing.T) {
939 t.Setenv("APP_BAR", "2")
940
941 for _, test := range uintFlagTests {
942 fl := &Uint64Flag{Name: test.name, Sources: EnvVars("APP_BAR")}
943 output := fl.String()
944
945 expectedSuffix := withEnvHint([]string{"APP_BAR"}, "")
946 if !strings.HasSuffix(output, expectedSuffix) {
947 t.Errorf("%s does not end with"+expectedSuffix, output)
948 }
949 }
950}
951
952func TestUintFlagValueFromCommand(t *testing.T) {
953 fl := &Uint64Flag{Name: "myflag"}

Callers

nothing calls this directly

Calls 3

EnvVarsFunction · 0.85
withEnvHintFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected