MCPcopy
hub / github.com/cli/cli / Test_run

Function Test_run

cmd/gen-docs/main_test.go:9–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func Test_run(t *testing.T) {
10 dir := t.TempDir()
11 args := []string{"--man-page", "--website", "--doc-path", dir}
12 err := run(args)
13 if err != nil {
14 t.Fatalf("got error: %v", err)
15 }
16
17 manPage, err := os.ReadFile(dir + "/gh-issue-create.1")
18 if err != nil {
19 t.Fatalf("error reading `gh-issue-create.1`: %v", err)
20 }
21 if !strings.Contains(string(manPage), `\fBgh issue create`) {
22 t.Fatal("man page corrupted")
23 }
24
25 markdownPage, err := os.ReadFile(dir + "/gh_issue_create.md")
26 if err != nil {
27 t.Fatalf("error reading `gh_issue_create.md`: %v", err)
28 }
29 if !strings.Contains(string(markdownPage), `## gh issue create`) {
30 t.Fatal("markdown page corrupted")
31 }
32}

Callers

nothing calls this directly

Calls 2

ContainsMethod · 0.80
runFunction · 0.70

Tested by

no test coverage detected