(t *testing.T)
| 284 | } |
| 285 | |
| 286 | func TestCompleteRunExec(t *testing.T) { |
| 287 | t.Parallel() |
| 288 | |
| 289 | tests := []struct { |
| 290 | name string |
| 291 | args []string |
| 292 | toComplete string |
| 293 | wantNoFileComp bool |
| 294 | }{ |
| 295 | { |
| 296 | name: "first arg completes agent file", |
| 297 | args: []string{}, |
| 298 | toComplete: "./", |
| 299 | wantNoFileComp: true, |
| 300 | }, |
| 301 | { |
| 302 | name: "third arg and beyond returns no completions", |
| 303 | args: []string{"agent.yaml", "message"}, |
| 304 | toComplete: "anything", |
| 305 | wantNoFileComp: true, |
| 306 | }, |
| 307 | } |
| 308 | |
| 309 | for _, tt := range tests { |
| 310 | t.Run(tt.name, func(t *testing.T) { |
| 311 | t.Parallel() |
| 312 | |
| 313 | cmd := &cobra.Command{} |
| 314 | _, directive := completeRunExec(cmd, tt.args, tt.toComplete) |
| 315 | |
| 316 | if tt.wantNoFileComp { |
| 317 | assert.NotEqual(t, cobra.ShellCompDirective(0), directive&cobra.ShellCompDirectiveNoFileComp, |
| 318 | "expected NoFileComp directive to be set") |
| 319 | } |
| 320 | }) |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | func TestCompleteTheme(t *testing.T) { |
| 325 | t.Parallel() |
nothing calls this directly
no test coverage detected