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

Function TestStringSliceFlagValueFromCommand

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

Source from the content-addressed store, hash-verified

855}
856
857func TestStringSliceFlagValueFromCommand(t *testing.T) {
858 f := &StringSliceFlag{Name: "myflag"}
859 cmd := &Command{
860 Flags: []Flag{
861 f,
862 },
863 }
864
865 require.NoError(t, cmd.Set("myflag", "a"))
866 require.NoError(t, cmd.Set("myflag", "b"))
867 require.NoError(t, cmd.Set("myflag", "c"))
868 require.Equal(t, []string{"a", "b", "c"}, cmd.StringSlice(f.Name))
869}
870
871var intFlagTests = []struct {
872 name string

Callers

nothing calls this directly

Calls 2

SetMethod · 0.95
StringSliceMethod · 0.95

Tested by

no test coverage detected