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

Function TestSelect

cli/cliui/select_test.go:15–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestSelect(t *testing.T) {
16 t.Parallel()
17 t.Run("Select", func(t *testing.T) {
18 t.Parallel()
19 ptty := ptytest.New(t)
20 msgChan := make(chan string)
21 go func() {
22 resp, err := newSelect(ptty, cliui.SelectOptions{
23 Options: []string{"First", "Second"},
24 })
25 assert.NoError(t, err)
26 msgChan <- resp
27 }()
28 require.Equal(t, "First", <-msgChan)
29 })
30}
31
32func newSelect(ptty *ptytest.PTY, opts cliui.SelectOptions) (string, error) {
33 value := ""

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
newSelectFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected