(t *testing.T)
| 1280 | } |
| 1281 | |
| 1282 | func TestUint64SliceFlagApply_ParentContext(t *testing.T) { |
| 1283 | _ = (&Command{ |
| 1284 | Flags: []Flag{ |
| 1285 | &Uint64SliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []uint64{1, 2, 3}}, |
| 1286 | }, |
| 1287 | Commands: []*Command{ |
| 1288 | { |
| 1289 | Name: "child", |
| 1290 | Action: func(_ context.Context, cmd *Command) error { |
| 1291 | require.Equalf( |
| 1292 | t, []uint64{1, 2, 3}, cmd.Uint64Slice("numbers"), |
| 1293 | "child context unable to view parent flag", |
| 1294 | ) |
| 1295 | return nil |
| 1296 | }, |
| 1297 | }, |
| 1298 | }, |
| 1299 | }).Run(buildTestContext(t), []string{"run", "child"}) |
| 1300 | } |
| 1301 | |
| 1302 | func TestUintSliceFlag_SetFromParentCommand(t *testing.T) { |
| 1303 | fl := &UintSliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []uint{1, 2, 3, 4}} |
nothing calls this directly
no test coverage detected