(t *testing.T)
| 4204 | } |
| 4205 | |
| 4206 | func TestCommand_Bool(t *testing.T) { |
| 4207 | pCmd := &Command{ |
| 4208 | Flags: []Flag{ |
| 4209 | &BoolFlag{ |
| 4210 | Name: "myflag", |
| 4211 | }, |
| 4212 | }, |
| 4213 | } |
| 4214 | cmd := &Command{ |
| 4215 | Flags: []Flag{ |
| 4216 | &BoolFlag{ |
| 4217 | Name: "top-flag", |
| 4218 | Value: true, |
| 4219 | }, |
| 4220 | }, |
| 4221 | parent: pCmd, |
| 4222 | } |
| 4223 | |
| 4224 | r := require.New(t) |
| 4225 | r.False(cmd.Bool("myflag")) |
| 4226 | r.True(cmd.Bool("top-flag")) |
| 4227 | } |
| 4228 | |
| 4229 | func TestCommand_Value(t *testing.T) { |
| 4230 | subCmd := &Command{ |