(t *testing.T)
| 230 | } |
| 231 | |
| 232 | func TestCompleteEngineNames(t *testing.T) { |
| 233 | cmd := &cobra.Command{} |
| 234 | |
| 235 | tests := []struct { |
| 236 | name string |
| 237 | toComplete string |
| 238 | wantLen int |
| 239 | }{ |
| 240 | { |
| 241 | name: "empty prefix returns all engines", |
| 242 | toComplete: "", |
| 243 | wantLen: 8, // antigravity, copilot, claude, codex, gemini, opencode, crush, pi |
| 244 | }, |
| 245 | { |
| 246 | name: "c prefix returns claude, codex, copilot, crush", |
| 247 | toComplete: "c", |
| 248 | wantLen: 4, |
| 249 | }, |
| 250 | { |
| 251 | name: "co prefix returns copilot, codex", |
| 252 | toComplete: "co", |
| 253 | wantLen: 2, |
| 254 | }, |
| 255 | { |
| 256 | name: "cop prefix returns copilot", |
| 257 | toComplete: "cop", |
| 258 | wantLen: 1, |
| 259 | }, |
| 260 | { |
| 261 | name: "x prefix returns nothing", |
| 262 | toComplete: "x", |
| 263 | wantLen: 0, |
| 264 | }, |
| 265 | } |
| 266 | |
| 267 | for _, tt := range tests { |
| 268 | t.Run(tt.name, func(t *testing.T) { |
| 269 | completions, directive := CompleteEngineNames(cmd, nil, tt.toComplete) |
| 270 | assert.Len(t, completions, tt.wantLen) |
| 271 | assert.Equal(t, cobra.ShellCompDirectiveNoFileComp, directive) |
| 272 | }) |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | func TestCompleteWorkflowNames(t *testing.T) { |
| 277 | // Create a temporary directory structure |
nothing calls this directly
no test coverage detected