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

Function TestPromptNonInteractiveMultiSelect_ByValue

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

Source from the content-addressed store, hash-verified

824}
825
826func TestPromptNonInteractiveMultiSelect_ByValue(t *testing.T) {
827 opts := []struct{ label, value string }{
828 {"github tools", "github"},
829 {"edit tools", "edit"},
830 {"bash tools", "bash"},
831 }
832
833 scanner := newScannerFromString("edit,bash")
834 got, err := promptNonInteractiveMultiSelect(scanner, "Pick tools", opts)
835 if err != nil {
836 t.Fatalf("unexpected error: %v", err)
837 }
838 if len(got) != 2 || got[0] != "edit" || got[1] != "bash" {
839 t.Errorf("got %v, want [edit bash]", got)
840 }
841}
842
843func TestPromptNonInteractiveMultiSelect_Empty(t *testing.T) {
844 opts := []struct{ label, value string }{{"Option A", "a"}}

Callers

nothing calls this directly

Calls 3

newScannerFromStringFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected