MCPcopy Create free account
hub / github.com/github/gh-aw / TestCompleteEngineNamesCaseSensitivity

Function TestCompleteEngineNamesCaseSensitivity

pkg/cli/completions_test.go:705–737  ·  view source on GitHub ↗

TestCompleteEngineNamesCaseSensitivity tests engine name completion is case-sensitive

(t *testing.T)

Source from the content-addressed store, hash-verified

703
704// TestCompleteEngineNamesCaseSensitivity tests engine name completion is case-sensitive
705func 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
740func TestValidEngineNamesConsistency(t *testing.T) {

Callers

nothing calls this directly

Calls 2

CompleteEngineNamesFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected