(t *testing.T)
| 939 | } |
| 940 | |
| 941 | func TestHelpCommandExecuted(t *testing.T) { |
| 942 | rootCmd := &Command{Use: "root", Long: "Long description", Run: emptyRun} |
| 943 | rootCmd.AddCommand(&Command{Use: "child", Run: emptyRun}) |
| 944 | |
| 945 | output, err := executeCommand(rootCmd, "help") |
| 946 | if err != nil { |
| 947 | t.Errorf("Unexpected error: %v", err) |
| 948 | } |
| 949 | |
| 950 | checkStringContains(t, output, rootCmd.Long) |
| 951 | } |
| 952 | |
| 953 | func TestHelpCommandExecutedOnChild(t *testing.T) { |
| 954 | rootCmd := &Command{Use: "root", Run: emptyRun} |
nothing calls this directly
no test coverage detected