Re: [PATCH v5 2/3] tests: use __gitcompadd to simplify completion tests

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

 



On Wed, Oct 17, 2012 at 7:50 PM, SZEDER Gábor <szeder@xxxxxxxxxx> wrote:
> On Sun, Oct 14, 2012 at 05:52:50PM +0200, Felipe Contreras wrote:
>> Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
>> ---
>>  t/t9902-completion.sh | 29 +++++++++--------------------
>>  1 file changed, 9 insertions(+), 20 deletions(-)
>>
>> diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
>> index 92d7eb4..49c6eb4 100755
>> --- a/t/t9902-completion.sh
>> +++ b/t/t9902-completion.sh
>> @@ -39,19 +39,18 @@ _get_comp_words_by_ref ()
>>       done
>>  }
>>
>> -print_comp ()
>> +__gitcompadd ()
>>  {
>> -     local IFS=$'\n'
>> -     echo "${COMPREPLY[*]}" > out
>> +     compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}" > out
>>  }
>
> Please don't.  Running compgen is a fundamental part of the completion
> script, therefore tests must run it as it is in the completion script
> and not some copy of it.

All right. I added this patch as an after though to help sell the idea
of __gitcompadd. Either  way I'm not to worried about overriding it,
we are not really exercising any code that could catch issues with
calling compgen; we probably need specialized tests for that. In fact
I amended the quote you are quoting above as it's totally different
from the proposed __gitcompadd, but it still works nonetheless.

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