(t *testing.T)
| 1426 | } |
| 1427 | |
| 1428 | func TestUint64SliceFlagApply_ParentCommand(t *testing.T) { |
| 1429 | _ = (&Command{ |
| 1430 | Flags: []Flag{ |
| 1431 | &Uint64SliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []uint64{1, 2, 3}}, |
| 1432 | }, |
| 1433 | Commands: []*Command{ |
| 1434 | { |
| 1435 | Name: "child", |
| 1436 | Action: func(_ context.Context, cmd *Command) error { |
| 1437 | require.Equalf( |
| 1438 | t, []uint64{1, 2, 3}, cmd.Uint64Slice("numbers"), |
| 1439 | "child context unable to view parent flag", |
| 1440 | ) |
| 1441 | return nil |
| 1442 | }, |
| 1443 | }, |
| 1444 | }, |
| 1445 | }).Run(buildTestContext(t), []string{"run", "child"}) |
| 1446 | } |
| 1447 | |
| 1448 | func TestUint64SliceFlag_SetFromParentCommand(t *testing.T) { |
| 1449 | fl := &Uint64SliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []uint64{1, 2, 3, 4}} |
nothing calls this directly
no test coverage detected