runCommand runs a CLI command while doing some additional niceties like validating options.
(ctx context.Context, t *testing.T, cmd TCommand, opts TOpts)
| 654 | // runCommand runs a CLI command while doing some additional niceties like |
| 655 | // validating options. |
| 656 | func runCommand[TCommand Command[TOpts], TOpts CommandOpts](ctx context.Context, t *testing.T, cmd TCommand, opts TOpts) (bool, error) { |
| 657 | t.Helper() |
| 658 | |
| 659 | require.NoError(t, opts.Validate()) |
| 660 | |
| 661 | return cmd.Run(ctx, opts) |
| 662 | } |
| 663 | |
| 664 | func withCommandBase[TCommand Command[TOpts], TOpts CommandOpts](t *testing.T, cmd TCommand) (TCommand, *bytes.Buffer) { |
| 665 | t.Helper() |
no test coverage detected
searching dependent graphs…