Since our online docs website renders pages by using the kramdown (a superset of Markdown) engine, we have to check against some known quirks of the syntax.
(t *testing.T)
| 63 | // of Markdown) engine, we have to check against some known quirks of the |
| 64 | // syntax. |
| 65 | func TestKramdownCompatibleDocs(t *testing.T) { |
| 66 | ios, _, _, _ := iostreams.Test() |
| 67 | f := &cmdutil.Factory{ |
| 68 | IOStreams: ios, |
| 69 | Config: func() (gh.Config, error) { return config.NewBlankConfig(), nil }, |
| 70 | Browser: &browser.Stub{}, |
| 71 | ExtensionManager: &extensions.ExtensionManagerMock{ |
| 72 | ListFunc: func() []extensions.Extension { |
| 73 | return nil |
| 74 | }, |
| 75 | }, |
| 76 | } |
| 77 | |
| 78 | cmd, err := NewCmdRoot(f, &telemetry.NoOpService{}, "N/A", "") |
| 79 | require.NoError(t, err) |
| 80 | |
| 81 | var walk func(*cobra.Command) |
| 82 | walk = func(cmd *cobra.Command) { |
| 83 | name := fmt.Sprintf("%q: test pipes are in code blocks", cmd.UseLine()) |
| 84 | t.Run(name, func(t *testing.T) { |
| 85 | assertPipesAreInCodeBlocks(t, cmd) |
| 86 | }) |
| 87 | for _, child := range cmd.Commands() { |
| 88 | walk(child) |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | walk(cmd) |
| 93 | } |
| 94 | |
| 95 | // If not in a code block or a code span, kramdown treats pipes ("|") as table |
| 96 | // column separators, even if there's no table header, or left/right table row |
nothing calls this directly
no test coverage detected