(t *testing.T)
| 1441 | } |
| 1442 | |
| 1443 | func TestCommand_Float64Flag(t *testing.T) { |
| 1444 | var meters float64 |
| 1445 | |
| 1446 | cmd := &Command{ |
| 1447 | Flags: []Flag{ |
| 1448 | &FloatFlag{Name: "height", Value: 1.5, Usage: "Set the height, in meters"}, |
| 1449 | }, |
| 1450 | Action: func(_ context.Context, cmd *Command) error { |
| 1451 | meters = cmd.Float("height") |
| 1452 | return nil |
| 1453 | }, |
| 1454 | } |
| 1455 | |
| 1456 | _ = cmd.Run(buildTestContext(t), []string{"", "--height", "1.93"}) |
| 1457 | assert.Equal(t, 1.93, meters) |
| 1458 | } |
| 1459 | |
| 1460 | func TestCommand_ParseSliceFlags(t *testing.T) { |
| 1461 | var parsedIntSlice []int64 |
nothing calls this directly
no test coverage detected