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

Function TestCompleteCmdInFishScript

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

Source from the content-addressed store, hash-verified

40}
41
42func TestCompleteCmdInFishScript(t *testing.T) {
43 rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun}
44 child := &Command{
45 Use: "child",
46 ValidArgsFunction: validArgsFunc,
47 Run: emptyRun,
48 }
49 rootCmd.AddCommand(child)
50
51 buf := new(bytes.Buffer)
52 assertNoErr(t, rootCmd.GenFishCompletion(buf, true))
53 output := buf.String()
54
55 check(t, output, ShellCompRequestCmd)
56 checkOmit(t, output, ShellCompNoDescRequestCmd)
57}
58
59func TestProgWithDash(t *testing.T) {
60 rootCmd := &Command{Use: "root-dash", Args: NoArgs, Run: emptyRun}

Callers

nothing calls this directly

Calls 6

AddCommandMethod · 0.95
GenFishCompletionMethod · 0.95
checkFunction · 0.85
checkOmitFunction · 0.85
StringMethod · 0.80
assertNoErrFunction · 0.70

Tested by

no test coverage detected