(t *testing.T)
| 1832 | } |
| 1833 | |
| 1834 | func 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 | |
| 1848 | func TestParseMultiStringSliceWithDefaults(t *testing.T) { |
| 1849 | _ = (&Command{ |
nothing calls this directly
no test coverage detected