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

Function TestCommand_Command

command_test.go:797–812  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

795}
796
797func 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
814var defaultCommandTests = []struct {
815 cmdName string

Callers

nothing calls this directly

Calls 1

CommandMethod · 0.95

Tested by

no test coverage detected