Skip to content

Commit

Permalink
completion: add comment for test_completion()
Browse files Browse the repository at this point in the history
So that it's easier to understand what it does.

Also, make sure we pass only the first argument for completion.
Shouldn't cause any functional changes because run_completion only
checks $1.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Felipe Contreras authored and Junio C Hamano committed Nov 16, 2012
1 parent 2cfceef commit 701ecdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion t/t9902-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ run_completion ()
__git_wrap__git_main && print_comp
}

# Test high-level completion
# Arguments are:
# 1: typed text so far (cur)
# 2: expected completion
test_completion ()
{
test $# -gt 1 && echo "$2" > expected
run_completion "$@" &&
run_completion "$1" &&
test_cmp expected out
}

Expand Down

0 comments on commit 701ecdf

Please sign in to comment.