TestCompleteEngineNamesCaseSensitivity tests engine name completion is case-sensitive
(t *testing.T)
| 703 | |
| 704 | // TestCompleteEngineNamesCaseSensitivity tests engine name completion is case-sensitive |
| 705 | func TestCompleteEngineNamesCaseSensitivity(t *testing.T) { |
| 706 | cmd := &cobra.Command{} |
| 707 | |
| 708 | tests := []struct { |
| 709 | name string |
| 710 | toComplete string |
| 711 | wantLen int |
| 712 | }{ |
| 713 | { |
| 714 | name: "lowercase copilot", |
| 715 | toComplete: "copilot", |
| 716 | wantLen: 1, // copilot |
| 717 | }, |
| 718 | { |
| 719 | name: "uppercase COPILOT should not match", |
| 720 | toComplete: "COPILOT", |
| 721 | wantLen: 0, |
| 722 | }, |
| 723 | { |
| 724 | name: "mixed case Copilot should not match", |
| 725 | toComplete: "Copilot", |
| 726 | wantLen: 0, |
| 727 | }, |
| 728 | } |
| 729 | |
| 730 | for _, tt := range tests { |
| 731 | t.Run(tt.name, func(t *testing.T) { |
| 732 | completions, directive := CompleteEngineNames(cmd, nil, tt.toComplete) |
| 733 | assert.Len(t, completions, tt.wantLen, "Expected %d completions", tt.wantLen) |
| 734 | assert.Equal(t, cobra.ShellCompDirectiveNoFileComp, directive) |
| 735 | }) |
| 736 | } |
| 737 | } |
| 738 | |
| 739 | // TestValidEngineNamesConsistency tests that ValidEngineNames returns consistent results |
| 740 | func TestValidEngineNamesConsistency(t *testing.T) { |
nothing calls this directly
no test coverage detected