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

Function TestProgWithColon

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

Source from the content-addressed store, hash-verified

72}
73
74func TestProgWithColon(t *testing.T) {
75 rootCmd := &Command{Use: "root:colon", Args: NoArgs, Run: emptyRun}
76 buf := new(bytes.Buffer)
77 assertNoErr(t, rootCmd.GenFishCompletion(buf, false))
78 output := buf.String()
79
80 // Functions name should have replace the ':'
81 check(t, output, "__root_colon_perform_completion")
82 checkOmit(t, output, "__root:colon_perform_completion")
83
84 // The command name should not have replaced the ':'
85 check(t, output, "-c root:colon")
86 checkOmit(t, output, "-c root_colon")
87}
88
89func TestFishCompletionNoActiveHelp(t *testing.T) {
90 c := &Command{Use: "c", Run: emptyRun}

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected