Re: [PATCH 09/19] tests: use test_write_lines() to generate line-oriented output

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

 



On Fri, Dec 10, 2021 at 4:22 AM Jeff King <peff@xxxxxxxx> wrote:
> On Thu, Dec 09, 2021 at 12:11:05AM -0500, Eric Sunshine wrote:
> >  test_expect_success 'color new trailing blank lines' '
> > -     { echo a; echo b; echo; echo; } >x &&
> > +     test_write_lines a b "" "" >x &&
> >       git add x &&
> > -     { echo a; echo; echo; echo; echo c; echo; echo; echo; echo; } >x &&
> > +     test_write_lines a "" "" "" c "" "" "" "" >x &&
>
> Some of these I think might be more readable as here-docs. But I think
> keeping to the minimal change here makes sense (and I admit I do not
> overly care much either way; it was just on my mind from the last
> patch).

Indeed, it's a judgment call, but I recall that it was all the
embedded and trailing blank lines in these particular cases which
pushed me toward test_write_lines() rather than here-docs since
test_write_lines() makes it way more compact, which perhaps makes it a
bit easier to get the number and placement of the blank lines correct.
The corresponding here-doc would have been:

    cat <<-\EOF >x &&
    a



    c




   EOF



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

  Powered by Linux