(t *testing.T)
| 227 | } |
| 228 | |
| 229 | func TestBashCompletionHiddenFlag(t *testing.T) { |
| 230 | c := &Command{Use: "c", Run: emptyRun} |
| 231 | |
| 232 | const flagName = "hiddenFlag" |
| 233 | c.Flags().Bool(flagName, false, "") |
| 234 | assertNoErr(t, c.Flags().MarkHidden(flagName)) |
| 235 | |
| 236 | buf := new(bytes.Buffer) |
| 237 | assertNoErr(t, c.GenBashCompletion(buf)) |
| 238 | output := buf.String() |
| 239 | |
| 240 | if strings.Contains(output, flagName) { |
| 241 | t.Errorf("Expected completion to not include %q flag: Got %v", flagName, output) |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | func TestBashCompletionDeprecatedFlag(t *testing.T) { |
| 246 | c := &Command{Use: "c", Run: emptyRun} |
nothing calls this directly
no test coverage detected