(t *testing.T)
| 87 | } |
| 88 | |
| 89 | func TestChildrenSortedAlphabetically(t *testing.T) { |
| 90 | cmd := newCmd("root", "help for root command") |
| 91 | cmd.AddCmd(newCmd("child2", "help for child1 command")) |
| 92 | cmd.AddCmd(newCmd("child1", "help for child2 command")) |
| 93 | children := cmd.Children() |
| 94 | assert.Equal(t, children[0].Name, "child1", "must be first") |
| 95 | assert.Equal(t, children[1].Name, "child2", "must be second") |
| 96 | } |