Skip to content

Commit 1e8f34c

Browse files
committed
Bump golang and golangci-lint
1 parent 6c49957 commit 1e8f34c

12 files changed

+108
-55
lines changed

.github/workflows/golangci-lint.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v2
1616
- name: golangci-lint
17-
uses: golangci/[email protected].1
17+
uses: golangci/[email protected].2
1818
with:
1919
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
20-
version: v1.39.0
20+
version: v1.42.0
2121

2222
# Optional: working directory, useful for monorepos
2323
# working-directory: somedir

.github/workflows/test.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ on:
88

99
env:
1010
GO111MODULE: "on"
11-
GO_LATEST_VERSION: "1.16.x"
11+
GO_LATEST_VERSION: "1.17.x"
1212

1313
jobs:
1414
test:
1515
strategy:
1616
fail-fast: false
1717
matrix:
1818
os: [ ubuntu-latest, macos-latest ]
19-
go-version: [ 1.14.x, 1.15.x, 1.16.x ]
19+
go-version: [ 1.16.x, 1.17.x ]
2020
runs-on: ${{ matrix.os }}
2121
steps:
2222
- name: Install Go

.golangci.yaml

+14-12
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,30 @@ linters-settings:
2020
linters:
2121
enable-all: true
2222
disable:
23-
- lll
24-
- maligned
25-
- gochecknoglobals
26-
- gomnd
27-
- wrapcheck
28-
- paralleltest
29-
- forbidigo
3023
- exhaustivestruct
31-
- interfacer
24+
- forbidigo
3225
- forcetypeassert
26+
- gci
27+
- gochecknoglobals
28+
- golint
29+
- gomnd
3330
- ifshort
31+
- interfacer
32+
- lll
33+
- maligned
34+
- paralleltest
35+
- scopelint
3436
- testpackage
35-
- gci
37+
- wrapcheck
3638

3739
issues:
3840
exclude-use-default: false
3941
exclude-rules:
4042
- linters:
41-
- gomnd
43+
- dupl
44+
- funlen
4245
- goconst
4346
- goerr113
47+
- gomnd
4448
- noctx
45-
- funlen
46-
- dupl
4749
path: "_test.go"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
## Prerequisites
1313

14-
- `Go >= 1.14`
14+
- `Go >= 1.16`
1515

1616
## Install
1717

expectation.go

+19
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,22 @@ func writeSelectList(sb *stringsBuilder, options []string, indicator *regexp.Reg
111111
Writef(o["option"])
112112
}
113113
}
114+
115+
// StringExpect expects a string from console.
116+
type StringExpect string
117+
118+
// Do runs the step.
119+
func (e StringExpect) Do(c Console) error {
120+
_, err := c.ExpectString(string(e))
121+
122+
return err
123+
}
124+
125+
// String represents the answer as a string.
126+
func (e StringExpect) String() string {
127+
return fmt.Sprintf("Expect a string: %q", string(e))
128+
}
129+
130+
func expectString(s string) StringExpect {
131+
return StringExpect(s)
132+
}

go.mod

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
module github.com/nhatthm/surveyexpect
22

3-
go 1.16
3+
go 1.17
44

55
require (
6-
github.com/AlecAivazis/survey/v2 v2.2.12
7-
github.com/Netflix/go-expect v0.0.0-20201125194554-85d881c3777e
8-
github.com/creack/pty v1.1.11 // indirect
6+
github.com/AlecAivazis/survey/v2 v2.3.1
7+
github.com/Netflix/go-expect v0.0.0-20210722184520-ef0bf57d82b3
98
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c
9+
github.com/stretchr/testify v1.7.0
10+
)
11+
12+
require (
13+
github.com/creack/pty v1.1.15 // indirect
14+
github.com/davecgh/go-spew v1.1.1 // indirect
15+
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
1016
github.com/kr/pty v1.1.8 // indirect
1117
github.com/mattn/go-colorable v0.1.8 // indirect
18+
github.com/mattn/go-isatty v0.0.13 // indirect
1219
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
13-
github.com/stretchr/testify v1.7.0
14-
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect
15-
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7 // indirect
16-
golang.org/x/term v0.0.0-20210422114643-f5beecf764ed // indirect
17-
golang.org/x/text v0.3.6 // indirect
20+
github.com/pmezard/go-difflib v1.0.0 // indirect
21+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 // indirect
22+
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect
23+
golang.org/x/text v0.3.3 // indirect
1824
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
1925
)

go.sum

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
github.com/AlecAivazis/survey/v2 v2.2.12 h1:5a07y93zA6SZ09gOa9wLVLznF5zTJMQ+pJ3cZK4IuO8=
2-
github.com/AlecAivazis/survey/v2 v2.2.12/go.mod h1:6d4saEvBsfSHXeN1a5OA5m2+HJ2LuVokllnC77pAIKI=
1+
github.com/AlecAivazis/survey/v2 v2.3.1 h1:lzkuHA60pER7L4eYL8qQJor4bUWlJe4V0gqAT19tdOA=
2+
github.com/AlecAivazis/survey/v2 v2.3.1/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg=
33
github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
4-
github.com/Netflix/go-expect v0.0.0-20201125194554-85d881c3777e h1:YYUPbL3iB9+Y/JYEXjCi9AolqiKIIJX/2aRR9TuKD6w=
5-
github.com/Netflix/go-expect v0.0.0-20201125194554-85d881c3777e/go.mod h1:68ORG0HSEWDuH5Eh73AFbYWZ1zT4Y+b0vhOa+vZRUdI=
4+
github.com/Netflix/go-expect v0.0.0-20210722184520-ef0bf57d82b3 h1:DM0Olh3jQEm4gVPLF0mI49+fm1+M1fXDtumX/fN/G4A=
5+
github.com/Netflix/go-expect v0.0.0-20210722184520-ef0bf57d82b3/go.mod h1:68ORG0HSEWDuH5Eh73AFbYWZ1zT4Y+b0vhOa+vZRUdI=
66
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
7-
github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw=
8-
github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
7+
github.com/creack/pty v1.1.15 h1:cKRCLMj3Ddm54bKSpemfQ8AtYFBhAI2MPmdys22fBdc=
8+
github.com/creack/pty v1.1.15/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
99
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1010
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1111
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -15,15 +15,20 @@ github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c/go.mod h1:DqJ97dSdRW
1515
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
1616
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
1717
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
18+
github.com/kr/pty v1.1.4 h1:5Myjjh3JY/NaAi4IsUbHADytDyl1VE1Y9PXDlL+P/VQ=
1819
github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
1920
github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI=
2021
github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw=
22+
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
2123
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
2224
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
2325
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
26+
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
2427
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
25-
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
2628
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
29+
github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA=
30+
github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
31+
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
2732
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
2833
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
2934
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
@@ -35,31 +40,25 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
3540
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
3641
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
3742
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
43+
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 h1:8dUaAV7K4uHsF56JQWkprecIQKdPHtR9jCHF5nB8uzc=
3844
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
39-
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b h1:7mWr3k41Qtv8XlltBkDkl8LoP3mpSgBW8BUoxtEdbXg=
40-
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
4145
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
42-
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
4346
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
4447
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
4548
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
46-
golang.org/x/sys v0.0.0-20190530182044-ad28b68e88f1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
4749
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
4850
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
51+
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
4952
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
50-
golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c=
51-
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
52-
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7 h1:iGu644GcxtEcrInvDsQRCwJjtCIOlT2V7IRt6ah2Whw=
53-
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
54-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
55-
golang.org/x/term v0.0.0-20210422114643-f5beecf764ed h1:Ei4bQjjpYUsS4efOUz+5Nz++IVkHk87n2zBA0NxBWc0=
56-
golang.org/x/term v0.0.0-20210422114643-f5beecf764ed/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
53+
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w=
54+
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
5755
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
56+
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
5857
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
59-
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
60-
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
6158
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
59+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
6260
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
61+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
6362
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
6463
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
6564
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

input.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ func (a *InputSuggestionSteps) append(steps ...Step) *InputSuggestionSteps {
232232
// Type("hello").
233233
// Tab(5)
234234
func (a *InputSuggestionSteps) Tab(times ...int) *InputSuggestionSteps {
235-
return a.append(repeatStep(pressTab(), times...)...)
235+
return a.append(repeatStep(pressTab(), times...)...).
236+
append(expectString(a.parent.message), expectString(`[Use arrows to move, enter to select, type to continue]`))
236237
}
237238

238239
// Esc sends the ESC key.
@@ -241,7 +242,7 @@ func (a *InputSuggestionSteps) Tab(times ...int) *InputSuggestionSteps {
241242
// Type("hello").
242243
// Esc()
243244
func (a *InputSuggestionSteps) Esc() *InputSuggestionSteps {
244-
return a.append(pressEsc())
245+
return a.append(pressEsc(), expectString(a.parent.message), expectString(`for suggestions]`))
245246
}
246247

247248
// Enter sends the ENTER key and ends the sequence.
@@ -254,14 +255,14 @@ func (a *InputSuggestionSteps) Enter() {
254255
a.steps.Close()
255256
}
256257

257-
// Interrupt sends ^C and ends the sequence.
258-
//
258+
// Interrupt sends ^C and closes the suggestions.
259259
// Survey.ExpectInput("Enter your name:").
260260
// Type("johnny").
261261
// Interrupt()
262-
func (a *InputSuggestionSteps) Interrupt() {
262+
func (a *InputSuggestionSteps) Interrupt() *InputSuggestionSteps {
263263
a.append(pressInterrupt())
264-
a.steps.Close()
264+
265+
return a
265266
}
266267

267268
// MoveUp sends the ARROW UP key the indicated times. Default is 1 when omitted.

input_test.go

+3
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ func TestInputPrompt_AskForSuggestionsThenInterrupt(t *testing.T) {
352352
"john.nguyen",
353353
"john.pierre",
354354
).
355+
Interrupt().
355356
Interrupt()
356357
})(t)
357358

@@ -418,6 +419,8 @@ func TestInputPrompt_AskForSuggestionsButThereIsNone(t *testing.T) {
418419
419420
Expect : Input Prompt
420421
Message: "Enter username:"
422+
Expect a string: "Enter username:"
423+
Expect a string: "[Use arrows to move, enter to select, type to continue]"
421424
Expect a select list:
422425
> john.doe
423426
john.lennon

multiselect_test.go

+13
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ func TestMultiSelectPrompt(t *testing.T) {
4747
scenario: "input is interrupted",
4848
expectSurvey: surveyexpect.Expect(func(s *surveyexpect.Survey) {
4949
s.ExpectMultiSelect("Select destinations").
50+
ExpectOptions(
51+
"> [ ] France",
52+
"[ ] Germany",
53+
"[ ] Malaysia",
54+
"[ ] Singapore",
55+
"[ ] Thailand",
56+
"[ ] United Kingdom",
57+
"[ ] United States",
58+
).
5059
Interrupt()
5160
}),
5261
expectedError: "interrupt",
@@ -208,6 +217,10 @@ func TestMultiSelectPrompt_SurveyInterrupted(t *testing.T) {
208217
scenario: "interrupt",
209218
expectSurvey: surveyexpect.Expect(func(s *surveyexpect.Survey) {
210219
s.ExpectMultiSelect("Select destinations").
220+
ExpectOptions(
221+
"> [ ] Germany",
222+
"[ ] Vietnam",
223+
).
211224
Interrupt()
212225
}),
213226
expectedError: "interrupt",

select.go

-3
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,11 @@ func (p *SelectPrompt) ExpectOptions(options ...string) *SelectPrompt {
100100
}
101101

102102
// Do runs the step.
103-
// nolint: errcheck
104103
func (p *SelectPrompt) Do(c Console) error {
105104
if _, err := c.ExpectString(p.message); err != nil {
106105
return err
107106
}
108107

109-
_, _ = c.ExpectString("\x1b[?25l")
110-
111108
return p.steps.Do(c)
112109
}
113110

select_test.go

+13
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ func TestSelectPrompt(t *testing.T) {
4747
scenario: "input is interrupted",
4848
expectSurvey: surveyexpect.Expect(func(s *surveyexpect.Survey) {
4949
s.ExpectSelect("Select a country").
50+
ExpectOptions(
51+
"> France",
52+
"Germany",
53+
"Malaysia",
54+
"Singapore",
55+
"Thailand",
56+
"United Kingdom",
57+
"United States",
58+
).
5059
Interrupt()
5160
}),
5261
expectedError: "interrupt",
@@ -185,6 +194,10 @@ func TestSelectPrompt_SurveyInterrupted(t *testing.T) {
185194
scenario: "interrupt",
186195
expectSurvey: surveyexpect.Expect(func(s *surveyexpect.Survey) {
187196
s.ExpectSelect("Select a country").
197+
ExpectOptions(
198+
"> Germany",
199+
"Vietnam",
200+
).
188201
Interrupt()
189202
}),
190203
expectedError: "interrupt",

0 commit comments

Comments
 (0)