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

Function TestPromptNonInteractiveMultiSelect_ByNumber

pkg/cli/interactive_test.go:809–824  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

807}
808
809func TestPromptNonInteractiveMultiSelect_ByNumber(t *testing.T) {
810 opts := []struct{ label, value string }{
811 {"github tools", "github"},
812 {"edit tools", "edit"},
813 {"bash tools", "bash"},
814 }
815
816 scanner := newScannerFromString("1,3")
817 got, err := promptNonInteractiveMultiSelect(scanner, "Pick tools", opts)
818 if err != nil {
819 t.Fatalf("unexpected error: %v", err)
820 }
821 if len(got) != 2 || got[0] != "github" || got[1] != "bash" {
822 t.Errorf("got %v, want [github bash]", got)
823 }
824}
825
826func TestPromptNonInteractiveMultiSelect_ByValue(t *testing.T) {
827 opts := []struct{ label, value string }{

Callers

nothing calls this directly

Calls 3

newScannerFromStringFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected