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

Function TestCommand_VisibleSubcCommands

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

Source from the content-addressed store, hash-verified

658}
659
660func TestCommand_VisibleSubcCommands(t *testing.T) {
661 subc1 := &Command{
662 Name: "subc1",
663 Usage: "subc1 command1",
664 }
665 subc3 := &Command{
666 Name: "subc3",
667 Usage: "subc3 command2",
668 }
669 cmd := &Command{
670 Name: "bar",
671 Usage: "this is for testing",
672 Commands: []*Command{
673 subc1,
674 {
675 Name: "subc2",
676 Usage: "subc2 command2",
677 Hidden: true,
678 },
679 subc3,
680 },
681 }
682
683 assert.Equal(t, cmd.VisibleCommands(), []*Command{subc1, subc3})
684}
685
686func TestCommand_VisibleFlagCategories(t *testing.T) {
687 cmd := &Command{

Callers

nothing calls this directly

Calls 1

VisibleCommandsMethod · 0.95

Tested by

no test coverage detected