(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestBoolWithInverseBasic(t *testing.T) { |
| 74 | flagMethod := func() *BoolWithInverseFlag { |
| 75 | return &BoolWithInverseFlag{ |
| 76 | Name: "env", |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | testCases := []*boolWithInverseTestCase{ |
| 81 | { |
| 82 | args: []string{"--no-env"}, |
| 83 | toBeSet: true, |
| 84 | value: false, |
| 85 | }, |
| 86 | { |
| 87 | args: []string{"--env"}, |
| 88 | toBeSet: true, |
| 89 | value: true, |
| 90 | }, |
| 91 | { |
| 92 | toBeSet: false, |
| 93 | value: false, |
| 94 | }, |
| 95 | { |
| 96 | args: []string{"--env", "--no-env"}, |
| 97 | err: errBothEnvFlagsAreSet, |
| 98 | }, |
| 99 | } |
| 100 | |
| 101 | err := runBoolWithInverseFlagTests(t, flagMethod, testCases) |
| 102 | if err != nil { |
| 103 | t.Error(err) |
| 104 | return |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | func TestBoolWithInverseAction(t *testing.T) { |
| 109 | err := fmt.Errorf("action called") |
nothing calls this directly
no test coverage detected