/
help.go
55 lines (51 loc) · 1.31 KB
/
help.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package main
import (
"github.com/h2non/survey"
"github.com/h2non/survey/tests/util"
)
var (
confirmAns = false
inputAns = ""
multiselectAns = []string{}
selectAns = ""
passwordAns = ""
)
var goodTable = []TestUtil.TestTableEntry{
{
"confirm", &survey.Confirm{
Message: "Is it raining?",
Help: "Go outside, if your head becomes wet the answer is probably 'yes'",
}, &confirmAns,
},
{
"input", &survey.Input{
Message: "What is your phone number:",
Help: "Phone number should include the area code, parentheses optional",
}, &inputAns,
},
{
"select", &survey.MultiSelect{
Message: "What days are you available:",
Help: "We are closed weekends and avaibility is limited on Wednesday",
Options: []string{"Monday", "Tuesday", "Wednesday", "Thursday", "Friday"},
Default: []string{"Monday", "Tuesday", "Thursday", "Friday"},
}, &multiselectAns,
},
{
"select", &survey.Select{
Message: "Choose a color:",
Help: "Blue is the best color, but it is your choice",
Options: []string{"red", "blue", "green"},
Default: "blue",
}, &selectAns,
},
{
"password", &survey.Password{
Message: "Enter a secret:",
Help: "Don't really enter a secret, this is just for testing",
}, &passwordAns,
},
}
func main() {
TestUtil.RunTable(goodTable)
}