Re: [PATCH 2/2] completion: simplify __gitcomp test helper
- From
SZEDER Gábor <szeder@ira.uka.de>
- Date
- Oct 30, 2012, 21:27 UTC
- Message-ID
- <20121030212725.GA15709@goldbirke>
- In-Reply-To
- <1350869941-22485-3-git-send-email-felipe.contreras@gmail.com>
On Mon, Oct 22, 2012 at 03:39:01AM +0200, Felipe Contreras wrote:
Show 12 quoted lines
> By using print_comp as suggested by SZEDER Gábor. > > Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> > --- > t/t9902-completion.sh | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > > diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh > index 1c6952a..2e7fc06 100755 > --- a/t/t9902-completion.sh > +++ b/t/t9902-completion.sh > @@ -74,15 +74,12 @@ newline=$'\n'
This $newline variable was only used to set IFS to a newline inside SQ blocks. AFAICS after this change there are no such places left, because print_comp() takes care of IFS, so $newline is not necessary anymore.
Show 22 quoted lines
> 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
>