(t *testing.T)
| 5009 | } |
| 5010 | |
| 5011 | func TestCommandCategories(t *testing.T) { |
| 5012 | var cc commandCategories = []*commandCategory{ |
| 5013 | { |
| 5014 | name: "foo", |
| 5015 | commands: []*Command{}, |
| 5016 | }, |
| 5017 | { |
| 5018 | name: "bar", |
| 5019 | commands: []*Command{}, |
| 5020 | }, |
| 5021 | { |
| 5022 | name: "goo", |
| 5023 | commands: nil, |
| 5024 | }, |
| 5025 | } |
| 5026 | |
| 5027 | sort.Sort(&cc) |
| 5028 | |
| 5029 | var prev *commandCategory |
| 5030 | for _, c := range cc { |
| 5031 | if prev != nil { |
| 5032 | assert.LessOrEqual(t, prev.name, c.name) |
| 5033 | } |
| 5034 | prev = c |
| 5035 | assert.Equal(t, []*Command(nil), c.VisibleCommands()) |
| 5036 | } |
| 5037 | } |
| 5038 | |
| 5039 | func TestCommandSliceFlagSeparator(t *testing.T) { |
| 5040 | cmd := &Command{ |
nothing calls this directly
no test coverage detected