(t *testing.T)
| 78 | } |
| 79 | |
| 80 | func TestHelpText(t *testing.T) { |
| 81 | cmd := newCmd("root", "help for root command") |
| 82 | cmd.AddCmd(newCmd("child1", "help for child1 command")) |
| 83 | cmd.AddCmd(newCmd("child2", "help for child2 command")) |
| 84 | res := cmd.HelpText() |
| 85 | expected := "\nhelp for root command\n\nCommands:\n child1 help for child1 command\n child2 help for child2 command\n\n" |
| 86 | assert.Equal(t, res, expected) |
| 87 | } |
| 88 | |
| 89 | func TestChildrenSortedAlphabetically(t *testing.T) { |
| 90 | cmd := newCmd("root", "help for root command") |