(t *testing.T)
| 24 | ) |
| 25 | |
| 26 | func TestGenRSTDoc(t *testing.T) { |
| 27 | // We generate on a subcommand so we have both subcommands and parents |
| 28 | buf := new(bytes.Buffer) |
| 29 | if err := GenReST(echoCmd, buf); err != nil { |
| 30 | t.Fatal(err) |
| 31 | } |
| 32 | output := buf.String() |
| 33 | |
| 34 | checkStringContains(t, output, echoCmd.Long) |
| 35 | checkStringContains(t, output, echoCmd.Example) |
| 36 | checkStringContains(t, output, "boolone") |
| 37 | checkStringContains(t, output, "rootflag") |
| 38 | checkStringContains(t, output, rootCmd.Short) |
| 39 | checkStringContains(t, output, echoSubCmd.Short) |
| 40 | checkStringOmits(t, output, deprecatedCmd.Short) |
| 41 | } |
| 42 | |
| 43 | func TestGenRSTNoHiddenParents(t *testing.T) { |
| 44 | // We generate on a subcommand so we have both subcommands and parents |
nothing calls this directly
no test coverage detected