MCPcopy
hub / github.com/cli/cli / TestGenManTree

Function TestGenManTree

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

Source from the content-addressed store, hash-verified

170}
171
172func TestGenManTree(t *testing.T) {
173 c := &cobra.Command{Use: "do [OPTIONS] arg1 arg2"}
174 tmpdir, err := os.MkdirTemp("", "test-gen-man-tree")
175 if err != nil {
176 t.Fatalf("Failed to create tmpdir: %s", err.Error())
177 }
178 defer os.RemoveAll(tmpdir)
179
180 if err := GenManTree(c, tmpdir); err != nil {
181 t.Fatalf("GenManTree failed: %s", err.Error())
182 }
183
184 if _, err := os.Stat(filepath.Join(tmpdir, "do.1")); err != nil {
185 t.Fatalf("Expected file 'do.1' to exist")
186 }
187}
188
189func TestManPrintFlagsShowsDefaultValues(t *testing.T) {
190 type TestOptions struct {

Callers

nothing calls this directly

Calls 3

GenManTreeFunction · 0.85
JoinMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected