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

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

 



Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 t/t9902-completion.sh |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 7b87f4c..6c61e7a 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -54,11 +54,12 @@ _get_comp_words_by_ref ()
 test_completion ()
 {
 	local -a COMPREPLY _words
-	local _cword
+	local _cword wrap
 	_words=( $1 )
 	test $# -gt 1 && echo "$2" > expected
+	wrap="${3-_git_wrap}"
 	(( _cword = ${#_words[@]} - 1 ))
-	_git_wrap && print_comp &&
+	$wrap && print_comp &&
 	test_cmp expected out
 }
 
@@ -305,4 +306,9 @@ test_expect_success 'global options extra checks' '
 	test_completion "git --no-pager tag -d v" "v0.1 "
 '
 
+test_expect_success 'aliases' '
+	git_complete gf git_fetch &&
+	test_completion "gf o" "origin " "_git_fetch_wrap"
+'
+
 test_done
-- 
1.7.10.3.g5a738d

--
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]