(t *testing.T)
| 243 | } |
| 244 | |
| 245 | func TestLoadCLIPluginsForCompletion(t *testing.T) { |
| 246 | settings.PluginsDirectory = "testdata/helmhome/helm/plugins" |
| 247 | |
| 248 | var out bytes.Buffer |
| 249 | |
| 250 | cmd := &cobra.Command{ |
| 251 | Use: "completion", |
| 252 | } |
| 253 | loadCLIPlugins(cmd, &out) |
| 254 | |
| 255 | tests := []staticCompletionDetails{ |
| 256 | {"args", []string{}, []string{}, []staticCompletionDetails{}}, |
| 257 | {"echo", []string{}, []string{}, []staticCompletionDetails{}}, |
| 258 | {"exitwith", []string{}, []string{}, []staticCompletionDetails{ |
| 259 | {"code", []string{}, []string{"a", "b"}, []staticCompletionDetails{}}, |
| 260 | }}, |
| 261 | {"fullenv", []string{}, []string{"q", "z"}, []staticCompletionDetails{ |
| 262 | {"empty", []string{}, []string{}, []staticCompletionDetails{}}, |
| 263 | {"full", []string{}, []string{}, []staticCompletionDetails{ |
| 264 | {"less", []string{}, []string{"a", "all"}, []staticCompletionDetails{}}, |
| 265 | {"more", []string{"one", "two"}, []string{"b", "ball"}, []staticCompletionDetails{}}, |
| 266 | }}, |
| 267 | }}, |
| 268 | {"shortenv", []string{}, []string{"global"}, []staticCompletionDetails{ |
| 269 | {"list", []string{}, []string{"a", "all", "log"}, []staticCompletionDetails{}}, |
| 270 | {"remove", []string{"all", "one"}, []string{}, []staticCompletionDetails{}}, |
| 271 | }}, |
| 272 | } |
| 273 | checkCommand(t, cmd.Commands(), tests) |
| 274 | } |
| 275 | |
| 276 | func checkCommand(t *testing.T, plugins []*cobra.Command, tests []staticCompletionDetails) { |
| 277 | t.Helper() |
nothing calls this directly
no test coverage detected
searching dependent graphs…