(t *testing.T)
| 223 | } |
| 224 | |
| 225 | func Test_Help_Nil_Flags(t *testing.T) { |
| 226 | oldFlag := HelpFlag |
| 227 | defer func() { |
| 228 | HelpFlag = oldFlag |
| 229 | }() |
| 230 | HelpFlag = nil |
| 231 | |
| 232 | cmd := &Command{ |
| 233 | Action: func(_ context.Context, cmd *Command) error { |
| 234 | return nil |
| 235 | }, |
| 236 | } |
| 237 | out := new(bytes.Buffer) |
| 238 | cmd.Writer = out |
| 239 | _ = cmd.Run(buildTestContext(t), []string{"test"}) |
| 240 | require.Len(t, out.String(), 0) |
| 241 | } |
| 242 | |
| 243 | func Test_Version_Custom_Flags(t *testing.T) { |
| 244 | oldFlag := VersionFlag |
nothing calls this directly
no test coverage detected