(t *testing.T)
| 152 | } |
| 153 | |
| 154 | func TestBoolWithInverseAlias(t *testing.T) { |
| 155 | flagMethod := func() *BoolWithInverseFlag { |
| 156 | return &BoolWithInverseFlag{ |
| 157 | Name: "env", |
| 158 | Aliases: []string{"e", "do-env"}, |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | testCases := []*boolWithInverseTestCase{ |
| 163 | { |
| 164 | args: []string{"--no-e"}, |
| 165 | toBeSet: true, |
| 166 | value: false, |
| 167 | }, |
| 168 | { |
| 169 | args: []string{"--e"}, |
| 170 | toBeSet: true, |
| 171 | value: true, |
| 172 | }, |
| 173 | { |
| 174 | toBeSet: false, |
| 175 | value: false, |
| 176 | }, |
| 177 | { |
| 178 | args: []string{"--do-env", "--no-do-env"}, |
| 179 | err: errBothEnvFlagsAreSet, |
| 180 | }, |
| 181 | } |
| 182 | |
| 183 | err := runBoolWithInverseFlagTests(t, flagMethod, testCases) |
| 184 | if err != nil { |
| 185 | t.Error(err) |
| 186 | return |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | func TestBoolWithInverseEnvVars(t *testing.T) { |
| 191 | flagMethod := func() *BoolWithInverseFlag { |
nothing calls this directly
no test coverage detected