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

Function TestDurationFlagWithEnvVarHelpOutput

flag_test.go:1018–1030  ·  flag_test.go::TestDurationFlagWithEnvVarHelpOutput
(t *testing.T)

Source from the content-addressed store, hash-verified

1016}
1017
1018func TestDurationFlagWithEnvVarHelpOutput(t *testing.T) {
1019 t.Setenv("APP_BAR", "2h3m6s")
1020
1021 for _, test := range durationFlagTests {
1022 fl := &DurationFlag{Name: test.name, Sources: EnvVars("APP_BAR")}
1023 output := fl.String()
1024
1025 expectedSuffix := withEnvHint([]string{"APP_BAR"}, "")
1026 if !strings.HasSuffix(output, expectedSuffix) {
1027 t.Errorf("%s does not end with"+expectedSuffix, output)
1028 }
1029 }
1030}
1031
1032func TestDurationFlagApply_SetsAllNames(t *testing.T) {
1033 v := time.Second * 20

Callers

nothing calls this directly

Calls 3

EnvVarsFunction · 0.85
withEnvHintFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected