(t *testing.T)
| 2271 | } |
| 2272 | |
| 2273 | func TestParseBoolShortOptionHandle(t *testing.T) { |
| 2274 | _ = (&Command{ |
| 2275 | Commands: []*Command{ |
| 2276 | { |
| 2277 | Name: "foobar", |
| 2278 | UseShortOptionHandling: true, |
| 2279 | Action: func(_ context.Context, cmd *Command) error { |
| 2280 | assert.True(t, cmd.Bool("serve"), "main name not set") |
| 2281 | assert.True(t, cmd.Bool("option"), "short name not set") |
| 2282 | return nil |
| 2283 | }, |
| 2284 | Flags: []Flag{ |
| 2285 | &BoolFlag{Name: "serve", Aliases: []string{"s"}}, |
| 2286 | &BoolFlag{Name: "option", Aliases: []string{"o"}}, |
| 2287 | }, |
| 2288 | }, |
| 2289 | }, |
| 2290 | }).Run(buildTestContext(t), []string{"run", "foobar", "-so"}) |
| 2291 | } |
| 2292 | |
| 2293 | func TestParseDestinationBool(t *testing.T) { |
| 2294 | var dest bool |
nothing calls this directly
no test coverage detected