(t *testing.T)
| 658 | } |
| 659 | |
| 660 | func 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 | |
| 686 | func TestCommand_VisibleFlagCategories(t *testing.T) { |
| 687 | cmd := &Command{ |
nothing calls this directly
no test coverage detected