MCPcopy
hub / github.com/cli/cli / TestGenManJSONFields

Function TestGenManJSONFields

internal/docs/man_test.go:116–130  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

114}
115
116func TestGenManJSONFields(t *testing.T) {
117 buf := new(bytes.Buffer)
118 header := &GenManHeader{}
119 if err := renderMan(jsonCmd, header, buf); err != nil {
120 t.Fatal(err)
121 }
122
123 output := buf.String()
124
125 checkStringContains(t, output, translate(jsonCmd.Name()))
126 checkStringContains(t, output, "JSON FIELDS")
127 checkStringContains(t, output, "foo")
128 checkStringContains(t, output, "bar")
129 checkStringContains(t, output, "baz")
130}
131
132func TestGenManDocExitCodes(t *testing.T) {
133 header := &GenManHeader{

Callers

nothing calls this directly

Calls 5

renderManFunction · 0.85
checkStringContainsFunction · 0.85
translateFunction · 0.85
NameMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected