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

Function TestBashCompletionNoActiveHelp

bash_completions_test.go:279–289  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

277}
278
279func TestBashCompletionNoActiveHelp(t *testing.T) {
280 c := &Command{Use: "c", Run: emptyRun}
281
282 buf := new(bytes.Buffer)
283 assertNoErr(t, c.GenBashCompletion(buf))
284 output := buf.String()
285
286 // check that active help is being disabled
287 activeHelpVar := activeHelpEnvVar(c.Name())
288 check(t, output, fmt.Sprintf("%s=0", activeHelpVar))
289}

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected