e2e.test --help

This commit is contained in:
caodonghui 2021-03-18 15:01:03 +08:00
parent e9632d93f7
commit d93ed65a35
2 changed files with 7 additions and 3 deletions

View File

@ -38,12 +38,16 @@ var _ goflag.Value = &StringSlice{}
var _ pflag.Value = &StringSlice{}
func (s *StringSlice) String() string {
if s == nil || s.value == nil {
return ""
}
return strings.Join(*s.value, " ")
}
func (s *StringSlice) Set(val string) error {
if s.value == nil || !s.changed {
*s.value = make([]string, 0)
v := make([]string, 0)
s.value = &v
}
*s.value = append(*s.value, val)
s.changed = true

View File

@ -83,8 +83,8 @@ func TestStringSlice(t *testing.T) {
} else if err != nil {
t.Errorf("%d: expected nil error, got %v", i, err)
}
if !reflect.DeepEqual(s, test.expected) {
t.Errorf("%d: expected %+v, got %+v", i, test.expected, s)
if !reflect.DeepEqual(*v.value, test.expected) {
t.Errorf("%d: expected %+v, got %+v", i, test.expected, *v.value)
}
if v.changed != test.changed {
t.Errorf("%d: expected %t got %t", i, test.changed, v.changed)