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

Function TestParseMultiStringSliceWithDefaults

flag_test.go:1848–1860  ·  flag_test.go::TestParseMultiStringSliceWithDefaults
(t *testing.T)

Source from the content-addressed store, hash-verified

1846}
1847
1848func TestParseMultiStringSliceWithDefaults(t *testing.T) {
1849 _ = (&Command{
1850 Flags: []Flag{
1851 &StringSliceFlag{Name: "serve", Aliases: []string{"s"}, Value: []string{"9", "2"}},
1852 },
1853 Action: func(_ context.Context, cmd *Command) error {
1854 expected := []string{"10", "20"}
1855 assert.Equal(t, expected, cmd.StringSlice("serve"), "main name not set")
1856 assert.Equal(t, expected, cmd.StringSlice("s"), "short name not set")
1857 return nil
1858 },
1859 }).Run(buildTestContext(t), []string{"run", "-s", "10", "-s", "20"})
1860}
1861
1862func TestParseMultiStringSliceWithDestination(t *testing.T) {
1863 dest := []string{}

Callers

nothing calls this directly

Calls 3

buildTestContextFunction · 0.85
StringSliceMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected