MCPcopy
hub / github.com/urfave/cli / TestCommandCategories

Function TestCommandCategories

command_test.go:5011–5037  ·  command_test.go::TestCommandCategories
(t *testing.T)

Source from the content-addressed store, hash-verified

5009}
5010
5011func 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
5039func TestCommandSliceFlagSeparator(t *testing.T) {
5040 cmd := &Command{

Callers

nothing calls this directly

Calls 1

VisibleCommandsMethod · 0.65

Tested by

no test coverage detected