Re: [PATCH v5 03/11] ref-filter: add option to pad atoms to the right

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

 



Karthik Nayak <karthik.188@xxxxxxxxx> writes:

> --- a/t/t6302-for-each-ref-filter.sh
> +++ b/t/t6302-for-each-ref-filter.sh
> @@ -81,4 +81,20 @@ test_expect_success 'filtering with --contains' '
>  	test_cmp expect actual
>  '
>  
> +test_expect_success 'padding to the right using `padright`' '
> +	cat >expect <<-\EOF &&
> +	refs/heads/master        |
> +	refs/heads/side          |
> +	refs/odd/spot            |
> +	refs/tags/double-tag     |
> +	refs/tags/four           |
> +	refs/tags/one            |
> +	refs/tags/signed-tag     |
> +	refs/tags/three          |
> +	refs/tags/two            |
> +	EOF
> +	git for-each-ref --format="%(padright:25)%(refname)|" >actual &&
> +	test_cmp expect actual
> +'
> +
>  test_done

See my remark on previous patch: this test is not sufficient. You do
not only need to check that %(padright) is taken into account, but you
also need to check that it is taken into account for the right atom and
only this one. I'd suggest

--format '%(refname)%(padright:25)|%(refname)|%(refname)|'

Only the middle column should be padded.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
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]