git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elijah Newren <newren@gmail.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 2/5] t6036, t6042: use test_line_count instead of wc -l
Date: Thu, 24 May 2018 10:03:09 -0700	[thread overview]
Message-ID: <CABPp-BGS27ScX7R7GUv6oEHdynjWOzgeoYvS-759wh936-APWA@mail.gmail.com> (raw)
In-Reply-To: <20180524100507.32305-1-szeder.dev@gmail.com>

On Thu, May 24, 2018 at 3:05 AM, SZEDER Gábor <szeder.dev@gmail.com> wrote:
>> --- a/t/t6036-recursive-corner-cases.sh
>> +++ b/t/t6036-recursive-corner-cases.sh
>> @@ -65,9 +65,12 @@ test_expect_success 'merge simple rename+criss-cross with no modifications' '
>>
>>               test_must_fail git merge -s recursive R2^0 &&
>>
>> -             test 2 = $(git ls-files -s | wc -l) &&
>> -             test 2 = $(git ls-files -u | wc -l) &&
>> -             test 2 = $(git ls-files -o | wc -l) &&
>
> Here 'git ls-files -o' should have listed two untracked files ...
>
>> +             git ls-files -s >out &&
>> +             test_line_count = 2 out &&
>> +             git ls-files -u >out &&
>> +             test_line_count = 2 out &&
>> +             git ls-files -o >out &&
>> +             test_line_count = 3 out &&
>
> ... but now you expect it to list three.  I was about to point out the
> typo, but then noticed that you expect it to list one more untracked
> file than before in all subsequent tests...  now that can't be just a
> typo, can it?
>
> Please mention in the commit message that when using an intermediate
> file to store the output, 'git ls-files -o' will list that file, too,
> that's why the number of expected untracked files had to be adjusted;
> so future readers won't have to figure this out themselves.

How does adding the following to the commit message sound?

    Changing to use test_line_count means using an intermediate file to store
    the output, which means that 'git ls-files -o' will have an additional
    file to list, which means that the number of lines expected in some tests
    will therefore change as well (unless the same intermediate file was used
    to capture the output of a previous command).

I'll include that in my next roll of the series after waiting for any
other fixups folks point out.  Sorry for the trouble.

As always, thanks for taking a look!

  parent reply	other threads:[~2018-05-24 17:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24  7:04 [PATCH 0/5] Modernize some testcases for merge-recursive corner cases Elijah Newren
2018-05-24  7:04 ` [PATCH 1/5] t6036, t6042: use test_create_repo to keep tests independent Elijah Newren
2018-05-24  7:04 ` [PATCH 2/5] t6036, t6042: use test_line_count instead of wc -l Elijah Newren
2018-05-24 10:05   ` SZEDER Gábor
2018-05-24 10:36     ` SZEDER Gábor
2018-05-24 17:03     ` Elijah Newren [this message]
2018-05-25  1:17     ` Junio C Hamano
2018-05-26  0:44       ` Elijah Newren
2018-05-24  7:04 ` [PATCH 3/5] t6036, t6042: prefer test_path_is_file, test_path_is_missing Elijah Newren
2018-05-24  7:04 ` [PATCH 4/5] t6036, t6042: prefer test_cmp to sequences of test Elijah Newren
2018-05-24  7:04 ` [PATCH 5/5] t6036: prefer test_when_finished to manual cleanup in following test Elijah Newren
     [not found] <CABPp-BEcTKaPPUOVqTRUAW+LBBySCK0dgx1J66hYB30yMasK_Q@mail.gmail.com/>
2018-05-26  1:09 ` [PATCH 2/5] t6036, t6042: use test_line_count instead of wc -l Elijah Newren
2018-05-26 23:58   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABPp-BGS27ScX7R7GUv6oEHdynjWOzgeoYvS-759wh936-APWA@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).