(t *testing.T)
| 147 | } |
| 148 | |
| 149 | func TestManPrintFlagsHidesShortDeprecated(t *testing.T) { |
| 150 | c := &cobra.Command{} |
| 151 | c.Flags().StringP("foo", "f", "default", "Foo flag") |
| 152 | assertNoErr(t, c.Flags().MarkShorthandDeprecated("foo", "don't use it no more")) |
| 153 | |
| 154 | buf := new(bytes.Buffer) |
| 155 | manPrintFlags(buf, c.Flags()) |
| 156 | |
| 157 | got := buf.String() |
| 158 | expected := "**--foo**=\"default\"\n\tFoo flag\n\n" |
| 159 | if got != expected { |
| 160 | t.Errorf("Expected %v, got %v", expected, got) |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | func TestGenManTree(t *testing.T) { |
| 165 | c := &cobra.Command{Use: "do [OPTIONS] arg1 arg2"} |
nothing calls this directly
no test coverage detected