(t *testing.T)
| 795 | } |
| 796 | |
| 797 | func TestCommand_Command(t *testing.T) { |
| 798 | cmd := &Command{ |
| 799 | Commands: []*Command{ |
| 800 | {Name: "foobar", Aliases: []string{"f"}}, |
| 801 | {Name: "batbaz", Aliases: []string{"b"}}, |
| 802 | }, |
| 803 | } |
| 804 | |
| 805 | for _, test := range commandTests { |
| 806 | if test.expected { |
| 807 | assert.NotEmpty(t, cmd.Command(test.name)) |
| 808 | } else { |
| 809 | assert.Empty(t, cmd.Command(test.name)) |
| 810 | } |
| 811 | } |
| 812 | } |
| 813 | |
| 814 | var defaultCommandTests = []struct { |
| 815 | cmdName string |