(t *testing.T)
| 1016 | } |
| 1017 | |
| 1018 | func 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 | |
| 1032 | func TestDurationFlagApply_SetsAllNames(t *testing.T) { |
| 1033 | v := time.Second * 20 |
nothing calls this directly
no test coverage detected