zsh-completion: test to verify that we're always running on root cmd.
This commit is contained in:
		
				
					committed by
					
						
						Steve Francia
					
				
			
			
				
	
			
			
			
						parent
						
							7b62c7df78
						
					
				
				
					commit
					66a98807d4
				
			@ -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 {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user