Merge pull request '[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/cli/RFC.md fully. Find features des...' (#58) from agent/read---spec-code-core-go-cli-rfc-md-full into dev
Some checks are pending
Security Scan / security (push) Waiting to run
Some checks are pending
Security Scan / security (push) Waiting to run
This commit is contained in:
commit
068071537f
2 changed files with 12 additions and 0 deletions
|
|
@ -84,6 +84,9 @@ func MultiSelect(label string, options []string) ([]string, error) {
|
||||||
|
|
||||||
r := newReader()
|
r := newReader()
|
||||||
input, err := r.ReadString('\n')
|
input, err := r.ReadString('\n')
|
||||||
|
if err != nil && strings.TrimSpace(input) == "" {
|
||||||
|
return []string{}, nil
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,15 @@ func TestMultiSelect_Good_CommasAndRanges(t *testing.T) {
|
||||||
assert.Equal(t, []string{"a", "b", "d"}, vals)
|
assert.Equal(t, []string{"a", "b", "d"}, vals)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestMultiSelect_Bad_EOFReturnsEmptySelection(t *testing.T) {
|
||||||
|
SetStdin(strings.NewReader(""))
|
||||||
|
defer SetStdin(nil)
|
||||||
|
|
||||||
|
vals, err := MultiSelect("Pick", []string{"a", "b", "c"})
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Empty(t, vals)
|
||||||
|
}
|
||||||
|
|
||||||
func TestConfirm_Good(t *testing.T) {
|
func TestConfirm_Good(t *testing.T) {
|
||||||
SetStdin(strings.NewReader("y\n"))
|
SetStdin(strings.NewReader("y\n"))
|
||||||
defer SetStdin(nil)
|
defer SetStdin(nil)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue