(t *testing.T)
| 81 | } |
| 82 | |
| 83 | func TestGenManSeeAlso(t *testing.T) { |
| 84 | rootCmd := &cobra.Command{Use: "root", Run: emptyRun} |
| 85 | aCmd := &cobra.Command{Use: "aaa", Run: emptyRun, Hidden: true} // #229 |
| 86 | bCmd := &cobra.Command{Use: "bbb", Run: emptyRun} |
| 87 | cCmd := &cobra.Command{Use: "ccc", Run: emptyRun} |
| 88 | rootCmd.AddCommand(aCmd, bCmd, cCmd) |
| 89 | |
| 90 | buf := new(bytes.Buffer) |
| 91 | header := &GenManHeader{} |
| 92 | if err := renderMan(rootCmd, header, buf); err != nil { |
| 93 | t.Fatal(err) |
| 94 | } |
| 95 | scanner := bufio.NewScanner(buf) |
| 96 | if err := assertLineFound(scanner, ".SH SEE ALSO"); err == nil { |
| 97 | t.Fatalf("Did not expect SEE ALSO section header") |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | func TestGenManAliases(t *testing.T) { |
| 102 | buf := new(bytes.Buffer) |
nothing calls this directly
no test coverage detected