From 66a98807d4036a0b21797ad8434b97a9ce0ae49d Mon Sep 17 00:00:00 2001 From: Haim Ashkenazi Date: Mon, 5 Mar 2018 01:09:55 +0200 Subject: [PATCH] zsh-completion: test to verify that we're always running on root cmd. --- zsh_completions_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/zsh_completions_test.go b/zsh_completions_test.go index b1321c9b..22a66d6d 100644 --- a/zsh_completions_test.go +++ b/zsh_completions_test.go @@ -134,6 +134,18 @@ func TestGenZshCompletion(t *testing.T) { }, skip: "--version and --help are currently not generated when not running on root command", }, + { + name: "zsh generation should run on root commannd", + root: func() *Command { + r := genTestCommand("root", false) + s := genTestCommand("sub1", true) + r.AddCommand(s) + return s + }(), + expectedExpressions: []string{ + "function _root {", + }, + }, } for _, tc := range tcs {