MCPcopy
hub / github.com/spf13/cobra / TestHiddenCommandIsHidden

Function TestHiddenCommandIsHidden

command_test.go:1906–1911  ·  view source on GitHub ↗

test to ensure hidden commands do not show up in usage/help text

(t *testing.T)

Source from the content-addressed store, hash-verified

1904
1905// test to ensure hidden commands do not show up in usage/help text
1906func TestHiddenCommandIsHidden(t *testing.T) {
1907 c := &Command{Use: "c", Hidden: true, Run: emptyRun}
1908 if c.IsAvailableCommand() {
1909 t.Errorf("Hidden command should be unavailable")
1910 }
1911}
1912
1913func TestCommandsAreSorted(t *testing.T) {
1914 EnableCommandSorting = true

Callers

nothing calls this directly

Calls 1

IsAvailableCommandMethod · 0.95

Tested by

no test coverage detected