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

Function TestFishCompletionNoActiveHelp

fish_completions_test.go:89–99  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

87}
88
89func TestFishCompletionNoActiveHelp(t *testing.T) {
90 c := &Command{Use: "c", Run: emptyRun}
91
92 buf := new(bytes.Buffer)
93 assertNoErr(t, c.GenFishCompletion(buf, true))
94 output := buf.String()
95
96 // check that active help is being disabled
97 activeHelpVar := activeHelpEnvVar(c.Name())
98 check(t, output, fmt.Sprintf("%s=0", activeHelpVar))
99}
100
101func TestGenFishCompletionFile(t *testing.T) {
102 tmpFile, err := os.CreateTemp("", "cobra-test")

Callers

nothing calls this directly

Calls 6

GenFishCompletionMethod · 0.95
NameMethod · 0.95
activeHelpEnvVarFunction · 0.85
checkFunction · 0.85
StringMethod · 0.80
assertNoErrFunction · 0.70

Tested by

no test coverage detected