(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestGenMdDoc(t *testing.T) { |
| 13 | linkHandler := func(s string) string { return s } |
| 14 | |
| 15 | // We generate on subcommand so we have both subcommands and parents. |
| 16 | buf := new(bytes.Buffer) |
| 17 | if err := genMarkdownCustom(echoCmd, buf, linkHandler); err != nil { |
| 18 | t.Fatal(err) |
| 19 | } |
| 20 | output := buf.String() |
| 21 | |
| 22 | checkStringContains(t, output, echoCmd.Long) |
| 23 | checkStringContains(t, output, echoCmd.Example) |
| 24 | checkStringContains(t, output, "boolone") |
| 25 | checkStringContains(t, output, "rootflag") |
| 26 | checkStringOmits(t, output, rootCmd.Short) |
| 27 | checkStringOmits(t, output, echoSubCmd.Short) |
| 28 | checkStringOmits(t, output, deprecatedCmd.Short) |
| 29 | checkStringContains(t, output, "Options inherited from parent commands") |
| 30 | } |
| 31 | |
| 32 | func TestGenMdDocWithNoLongOrSynopsis(t *testing.T) { |
| 33 | linkHandler := func(s string) string { return s } |
nothing calls this directly
no test coverage detected