(t *testing.T)
| 1141 | } |
| 1142 | |
| 1143 | func TestIntSliceFlagApply_ParentContext(t *testing.T) { |
| 1144 | _ = (&Command{ |
| 1145 | Flags: []Flag{ |
| 1146 | &Int64SliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []int64{1, 2, 3}}, |
| 1147 | }, |
| 1148 | Commands: []*Command{ |
| 1149 | { |
| 1150 | Name: "child", |
| 1151 | Action: func(_ context.Context, cmd *Command) error { |
| 1152 | require.Equalf(t, []int64{1, 2, 3}, cmd.Int64Slice("numbers"), "child context unable to view parent flag") |
| 1153 | |
| 1154 | return nil |
| 1155 | }, |
| 1156 | }, |
| 1157 | }, |
| 1158 | }).Run(buildTestContext(t), []string{"run", "child"}) |
| 1159 | } |
| 1160 | |
| 1161 | func TestIntSliceFlag_SetFromParentCommand(t *testing.T) { |
| 1162 | fl := &Int64SliceFlag{Name: "numbers", Aliases: []string{"n"}, Value: []int64{1, 2, 3, 4}} |
nothing calls this directly
no test coverage detected