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

Function TestProgWithDash

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

Source from the content-addressed store, hash-verified

57}
58
59func TestProgWithDash(t *testing.T) {
60 rootCmd := &Command{Use: "root-dash", Args: NoArgs, Run: emptyRun}
61 buf := new(bytes.Buffer)
62 assertNoErr(t, rootCmd.GenFishCompletion(buf, false))
63 output := buf.String()
64
65 // Functions name should have replace the '-'
66 check(t, output, "__root_dash_perform_completion")
67 checkOmit(t, output, "__root-dash_perform_completion")
68
69 // The command name should not have replaced the '-'
70 check(t, output, "-c root-dash")
71 checkOmit(t, output, "-c root_dash")
72}
73
74func TestProgWithColon(t *testing.T) {
75 rootCmd := &Command{Use: "root:colon", Args: NoArgs, 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