MCPcopy Index your code
hub / github.com/coder/coder / newSelect

Function newSelect

cli/cliui/select_test.go:32–44  ·  view source on GitHub ↗
(ptty *ptytest.PTY, opts cliui.SelectOptions)

Source from the content-addressed store, hash-verified

30}
31
32func newSelect(ptty *ptytest.PTY, opts cliui.SelectOptions) (string, error) {
33 value := ""
34 cmd := &serpent.Command{
35 Handler: func(inv *serpent.Invocation) error {
36 var err error
37 value, err = cliui.Select(inv, opts)
38 return err
39 },
40 }
41 inv := cmd.Invoke()
42 ptty.Attach(inv)
43 return value, inv.Run()
44}
45
46func TestRichSelect(t *testing.T) {
47 t.Parallel()

Callers 1

TestSelectFunction · 0.85

Calls 4

SelectFunction · 0.92
AttachMethod · 0.65
RunMethod · 0.65
InvokeMethod · 0.45

Tested by

no test coverage detected