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

Function TestDurationFlagValueFromCommand

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

Source from the content-addressed store, hash-verified

1042}
1043
1044func TestDurationFlagValueFromCommand(t *testing.T) {
1045 f := &DurationFlag{Name: "myflag"}
1046 cmd := &Command{
1047 Flags: []Flag{
1048 f,
1049 },
1050 }
1051 require.NoError(t, cmd.Set("myflag", "42s"))
1052 require.Equal(t, 42*time.Second, cmd.Duration(f.Name))
1053}
1054
1055var intSliceFlagTests = []struct {
1056 name string

Callers

nothing calls this directly

Calls 2

SetMethod · 0.95
DurationMethod · 0.95

Tested by

no test coverage detected