Re: [PATCH 11/12] test: add tests for aliases in bash completion
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Apr 8, 2012, 03:20 UTC
- Message-ID
- <CAMP44s2h==jd4fNFSSJXC2xTkHDozRSrH_2CHDzSB5=Jfu9uWA@mail.gmail.com>
- In-Reply-To
- <1333854479-23260-12-git-send-email-felipe.contreras@gmail.com>
On Sun, Apr 8, 2012 at 6:07 AM, Felipe Contreras <felipe.contreras@gmail.com> wrote:
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> > --- > t/t9902-completion.sh | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-)
Maybe something like this would be better:
--- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -58,7 +58,7 @@ test_completion () _words=( $1 ) test $# -gt 1 && echo "$2" > expected (( _cword = ${#_words[@]} - 1 )) - _git_wrap && print_comp && + ${comp_wrap-_git_wrap} && print_comp && test_cmp expected out } @@ -305,4 +305,11 @@ test_expect_success 'global options extra checks' ' test_completion "git --no-pager tag -d v" "v0.1 " ' +test_expect_success 'aliases' ' + local comp_wrap=_git_fetch_wrap && + git_complete gf git_fetch && + test_completion "gf o" "origin " && + test_completion "gf origin m" "master:master " +' + test_done
-- Felipe Contreras