mirror of https://github.com/spf13/cobra.git
zsh-completion: remove bad test
I thought there was a bug in the boolSlice definition but it seems It was my mistake in identifying what's going on. Also removed the provisioning to skip tests (doesn't seem to be needed anymore).
This commit is contained in:
parent
0d9a33d2da
commit
91e80cc4a4
|
@ -15,7 +15,6 @@ func TestGenZshCompletion(t *testing.T) {
|
||||||
name string
|
name string
|
||||||
root *Command
|
root *Command
|
||||||
expectedExpressions []string
|
expectedExpressions []string
|
||||||
skip string
|
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "simple command",
|
name: "simple command",
|
||||||
|
@ -112,18 +111,6 @@ func TestGenZshCompletion(t *testing.T) {
|
||||||
`'\(\*-d \*--debug\)'{\\\*-d,\\\*--debug}`,
|
`'\(\*-d \*--debug\)'{\\\*-d,\\\*--debug}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "boolSlice should not accept arguments",
|
|
||||||
root: func() *Command {
|
|
||||||
r := genTestCommand("mycmd", true)
|
|
||||||
r.Flags().BoolSlice("verbose", []bool{}, "verbosity level")
|
|
||||||
return r
|
|
||||||
}(),
|
|
||||||
expectedExpressions: []string{
|
|
||||||
`'\*--verbose\[verbosity level]'`,
|
|
||||||
},
|
|
||||||
skip: "BoolSlice behaves strangely both with NoOptDefVal and type (identifies as bool)",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range tcs {
|
for _, tc := range tcs {
|
||||||
|
@ -135,10 +122,6 @@ func TestGenZshCompletion(t *testing.T) {
|
||||||
}
|
}
|
||||||
output := buf.Bytes()
|
output := buf.Bytes()
|
||||||
|
|
||||||
if tc.skip != "" {
|
|
||||||
t.Skip("Skipping:", tc.skip)
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, expr := range tc.expectedExpressions {
|
for _, expr := range tc.expectedExpressions {
|
||||||
rgx, err := regexp.Compile(expr)
|
rgx, err := regexp.Compile(expr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue