From: Felipe Contreras Date: Sun, 11 Nov 2012 14:35:58 GMT Subject: [PATCH v2 6/6] completion: simplify __gitcomp() test helper Message-ID: <1352644558-9410-7-git-send-email-felipe.contreras@gmail.com> In-Reply-To: <1352644558-9410-1-git-send-email-felipe.contreras@gmail.com> By using print_comp as suggested by SZEDER Gábor. Signed-off-by: Felipe Contreras --- t/t9902-completion.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 66c7af6..9b38b69 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -69,23 +69,18 @@ test_completion () test_cmp expected out } -newline=$'\n' - # Test __gitcomp. # Arguments are: # 1: typed text so far (cur) # *: arguments to pass to __gitcomp test_gitcomp () { + local -a COMPREPLY && sed -e 's/Z$//' > expected && - ( - local -a COMPREPLY && - cur="$1" && - shift && - __gitcomp "$@" && - IFS="$newline" && - echo "${COMPREPLY[*]}" > out - ) && + cur="$1" && + shift && + __gitcomp "$@" && + print_comp && test_cmp expected out } -- 1.8.0