(t *testing.T)
| 1583 | } |
| 1584 | |
| 1585 | func TestRemoveCommand(t *testing.T) { |
| 1586 | rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun} |
| 1587 | childCmd := &Command{Use: "child", Run: emptyRun} |
| 1588 | rootCmd.AddCommand(childCmd) |
| 1589 | rootCmd.RemoveCommand(childCmd) |
| 1590 | |
| 1591 | _, err := executeCommand(rootCmd, "child") |
| 1592 | if err == nil { |
| 1593 | t.Error("Expected error on calling removed command. Got nil.") |
| 1594 | } |
| 1595 | } |
| 1596 | |
| 1597 | func TestReplaceCommandWithRemove(t *testing.T) { |
| 1598 | childUsed := 0 |
nothing calls this directly
no test coverage detected