(t *testing.T)
| 292 | } |
| 293 | |
| 294 | func TestBoolWithInverseRequired(t *testing.T) { |
| 295 | flagMethod := func() *BoolWithInverseFlag { |
| 296 | return &BoolWithInverseFlag{ |
| 297 | Name: "env", |
| 298 | Required: true, |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | testCases := []*boolWithInverseTestCase{ |
| 303 | { |
| 304 | args: []string{"--no-env"}, |
| 305 | toBeSet: true, |
| 306 | value: false, |
| 307 | }, |
| 308 | { |
| 309 | args: []string{"--env"}, |
| 310 | toBeSet: true, |
| 311 | value: true, |
| 312 | }, |
| 313 | { |
| 314 | args: []string{"--env", "--no-env"}, |
| 315 | err: errBothEnvFlagsAreSet, |
| 316 | }, |
| 317 | } |
| 318 | |
| 319 | err := runBoolWithInverseFlagTests(t, flagMethod, testCases) |
| 320 | if err != nil { |
| 321 | t.Error(err) |
| 322 | return |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | func TestBoolWithInverseNames(t *testing.T) { |
| 327 | flag := &BoolWithInverseFlag{ |
nothing calls this directly
no test coverage detected