(t *testing.T)
| 389 | } |
| 390 | |
| 391 | func Test_helpSubcommand_Action_ErrorIfNoTopic(t *testing.T) { |
| 392 | cmd := &Command{} |
| 393 | _ = cmd.Run(context.Background(), []string{"foo", "bar"}) |
| 394 | |
| 395 | err := helpCommandAction(context.Background(), cmd) |
| 396 | require.Error(t, err, "expected error from helpCommandAction(), but got nil") |
| 397 | |
| 398 | exitErr, ok := err.(*exitError) |
| 399 | require.True(t, ok, "expected *exitError from helpCommandAction(), but instead got: %v", err.Error()) |
| 400 | |
| 401 | require.Contains(t, exitErr.Error(), "No help topic for", "expected an unknown help topic error") |
| 402 | require.Equal(t, 3, exitErr.exitCode, "unexpected exit value") |
| 403 | } |
| 404 | |
| 405 | func TestShowRootCommandHelp_CommandAliases(t *testing.T) { |
| 406 | out := &bytes.Buffer{} |
nothing calls this directly
no test coverage detected