mirror of https://github.com/spf13/cobra.git
20 lines
394 B
Go
20 lines
394 B
Go
|
package cobra
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestZshCompletionWithActiveHelp(t *testing.T) {
|
||
|
c := &Command{Use: "c", Run: emptyRun}
|
||
|
|
||
|
buf := new(bytes.Buffer)
|
||
|
assertNoErr(t, c.GenZshCompletion(buf))
|
||
|
output := buf.String()
|
||
|
|
||
|
// check that active help is not being disabled
|
||
|
activeHelpVar := activeHelpEnvVar(c.Name())
|
||
|
checkOmit(t, output, fmt.Sprintf("%s=0", activeHelpVar))
|
||
|
}
|