From: Felipe Contreras Date: Sun, 08 Apr 2012 03:20:38 GMT Subject: Re: [PATCH 11/12] test: add tests for aliases in bash completion Message-ID: In-Reply-To: <1333854479-23260-12-git-send-email-felipe.contreras@gmail.com> On Sun, Apr 8, 2012 at 6:07 AM, Felipe Contreras wrote: > Signed-off-by: Felipe Contreras > --- >  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