Re: [PATCH 11/12] test: add tests for aliases in bash completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 8, 2012 at 6:07 AM, Felipe Contreras
<felipe.contreras@xxxxxxxxx> wrote:
> Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]