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

Function TestStringFlagValueFromCommand

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

Source from the content-addressed store, hash-verified

719}
720
721func TestStringFlagValueFromCommand(t *testing.T) {
722 f := &StringFlag{Name: "myflag"}
723 cmd := &Command{
724 Flags: []Flag{
725 f,
726 },
727 }
728 require.NoError(t, cmd.Set("myflag", "foobar"))
729 require.Equal(t, "foobar", cmd.String(f.Name))
730}
731
732var _ = []struct {
733 name string

Callers

nothing calls this directly

Calls 2

SetMethod · 0.95
StringMethod · 0.95

Tested by

no test coverage detected