()
| 16 | ) |
| 17 | |
| 18 | func setupCobraCommands() (*cobra.Command, *cobra.Command, *cobra.Command) { |
| 19 | rootCmd := &cobra.Command{ |
| 20 | Use: "root [OPTIONS] COMMAND [ARG...]", |
| 21 | } |
| 22 | childCmd := &cobra.Command{ |
| 23 | Use: "child [OPTIONS] COMMAND [ARG...]", |
| 24 | } |
| 25 | grandchildCmd := &cobra.Command{ |
| 26 | Use: "grandchild [OPTIONS] COMMAND [ARG...]", |
| 27 | } |
| 28 | childCmd.AddCommand(grandchildCmd) |
| 29 | rootCmd.AddCommand(childCmd) |
| 30 | |
| 31 | return rootCmd, childCmd, grandchildCmd |
| 32 | } |
| 33 | |
| 34 | func TestGetFullCommandName(t *testing.T) { |
| 35 | rootCmd, childCmd, grandchildCmd := setupCobraCommands() |
no outgoing calls
no test coverage detected
searching dependent graphs…