(t *testing.T)
| 1605 | } |
| 1606 | |
| 1607 | func TestCompleteCmdInZshScript(t *testing.T) { |
| 1608 | rootCmd := &Command{Use: "root", Args: NoArgs, Run: emptyRun} |
| 1609 | child := &Command{ |
| 1610 | Use: "child", |
| 1611 | ValidArgsFunction: validArgsFunc, |
| 1612 | Run: emptyRun, |
| 1613 | } |
| 1614 | rootCmd.AddCommand(child) |
| 1615 | |
| 1616 | buf := new(bytes.Buffer) |
| 1617 | assertNoErr(t, rootCmd.GenZshCompletion(buf)) |
| 1618 | output := buf.String() |
| 1619 | |
| 1620 | check(t, output, ShellCompRequestCmd) |
| 1621 | checkOmit(t, output, ShellCompNoDescRequestCmd) |
| 1622 | } |
| 1623 | |
| 1624 | func TestFlagCompletionInGo(t *testing.T) { |
| 1625 | rootCmd := &Command{ |
nothing calls this directly
no test coverage detected