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

Function TestParseMultiStringSlice

flag_test.go:1834–1846  ·  flag_test.go::TestParseMultiStringSlice
(t *testing.T)

Source from the content-addressed store, hash-verified

1832}
1833
1834func TestParseMultiStringSlice(t *testing.T) {
1835 _ = (&Command{
1836 Flags: []Flag{
1837 &StringSliceFlag{Name: "serve", Aliases: []string{"s"}, Value: []string{}},
1838 },
1839 Action: func(_ context.Context, cmd *Command) error {
1840 expected := []string{"10", "20"}
1841 assert.Equal(t, expected, cmd.StringSlice("serve"), "main name not set")
1842 assert.Equal(t, expected, cmd.StringSlice("s"), "short name not set")
1843 return nil
1844 },
1845 }).Run(buildTestContext(t), []string{"run", "-s", "10", "-s", "20"})
1846}
1847
1848func TestParseMultiStringSliceWithDefaults(t *testing.T) {
1849 _ = (&Command{

Callers

nothing calls this directly

Calls 3

buildTestContextFunction · 0.85
StringSliceMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected