On Tue, Jul 28, 2015 at 2:15 PM, Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> wrote: > Karthik Nayak <karthik.188@xxxxxxxxx> writes: > >> --- a/t/t6302-for-each-ref-filter.sh >> +++ b/t/t6302-for-each-ref-filter.sh >> @@ -133,4 +133,20 @@ test_expect_success 'reverse version sort' ' >> test_cmp expect actual >> ' >> >> +get_color () >> +{ >> + git config --get-color no.such.slot "$1" >> +} >> + >> +cat >expect <<EOF && >> +$(get_color green)foo1.10$(get_color reset)|| >> +$(get_color green)foo1.3$(get_color reset)|| >> +$(get_color green)foo1.6$(get_color reset)|| >> +EOF >> + >> +test_expect_success 'check `colornext` format option' ' >> + git for-each-ref --format="%(colornext:green)%(refname:short)||" | grep "foo" >actual && >> + test_cmp expect actual >> +' > > This is not a very good test: you're not checking that colornext applies > to the next and only this one. Similarly to what I suggested for > padright, I'd suggest > > --format="%(refname:short)%(colornext:green)|%(refname:short)|%(refname:short)|" > That was the purpose of the "||" but that doesn't check the color of next atom, Thanks for the example will use that :) -- Regards, Karthik Nayak -- 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