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

Function TestHelpFlagExecuted

command_test.go:1064–1073  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1062}
1063
1064func TestHelpFlagExecuted(t *testing.T) {
1065 rootCmd := &Command{Use: "root", Long: "Long description", Run: emptyRun}
1066
1067 output, err := executeCommand(rootCmd, "--help")
1068 if err != nil {
1069 t.Errorf("Unexpected error: %v", err)
1070 }
1071
1072 checkStringContains(t, output, rootCmd.Long)
1073}
1074
1075func TestHelpFlagExecutedOnChild(t *testing.T) {
1076 rootCmd := &Command{Use: "root", Run: emptyRun}

Callers

nothing calls this directly

Calls 2

executeCommandFunction · 0.85
checkStringContainsFunction · 0.70

Tested by

no test coverage detected