MCPcopy Index your code
hub / github.com/cli/cli / TestGenMdDocWithNoLongOrSynopsis

Function TestGenMdDocWithNoLongOrSynopsis

internal/docs/markdown_test.go:32–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30}
31
32func TestGenMdDocWithNoLongOrSynopsis(t *testing.T) {
33 linkHandler := func(s string) string { return s }
34
35 // We generate on subcommand so we have both subcommands and parents.
36 buf := new(bytes.Buffer)
37 if err := genMarkdownCustom(dummyCmd, buf, linkHandler); err != nil {
38 t.Fatal(err)
39 }
40 output := buf.String()
41
42 checkStringContains(t, output, dummyCmd.Example)
43 checkStringContains(t, output, dummyCmd.Short)
44 checkStringContains(t, output, "Options inherited from parent commands")
45 checkStringOmits(t, output, "### Synopsis")
46}
47
48func TestGenMdNoHiddenParents(t *testing.T) {
49 linkHandler := func(s string) string { return s }

Callers

nothing calls this directly

Calls 4

genMarkdownCustomFunction · 0.85
checkStringContainsFunction · 0.85
checkStringOmitsFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected