public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: David Aguilar <davvid@gmail•com>
Cc: Johannes Sixt <j6t@kdbg•org>,
	Git Mailing List <git@vger•kernel.org>,
	Sitaram Chamarty <sitaramc@gmail•com>
Subject: Re: difftool--helper: exit when reading a prompt answer fails
Date: Mon, 27 Oct 2014 10:38:15 -0700	[thread overview]
Message-ID: <xmqqa94hfm60.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20141027004148.GB81127@gmail.com> (David Aguilar's message of "Sun, 26 Oct 2014 17:41:49 -0700")

David Aguilar <davvid@gmail•com> writes:

>> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
>> index dc30a51..9cf5dc9 100755
>> --- a/t/t7800-difftool.sh
>> +++ b/t/t7800-difftool.sh
>> @@ -301,6 +301,14 @@ test_expect_success PERL 'say no to the second file' '
>>  	! grep br2 output
>>  '
>>  
>> +test_expect_success PERL 'ending prompt input with EOF' '
>> +	git difftool -x cat branch </dev/null >output &&
>> +	! grep master output &&
>> +	! grep branch output &&
>> +	! grep m2 output &&
>> +	! grep br2 output
>> +'
>
> Should we use "test_must_fail grep ..." instead of "! grep ..." here?

NO.  We do not expect system-supplied "grep" to dump core and
declare it as a test failure.  test_must_fail is for catching an
expected non-zero status exit from git commands, i.e. when we expect
our binary to correctly notice some condition and report that fact
with non-zero exit status, we do not want to mistake the binary
segfaulting as working correctly.

  parent reply	other threads:[~2014-10-27 17:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-26  8:09 difftool--helper: exit when reading a prompt answer fails Johannes Sixt
2014-10-27  0:41 ` David Aguilar
2014-10-27  1:10   ` David Aguilar
2014-10-27 12:54     ` Michael J Gruber
2014-10-27 17:38   ` Junio C Hamano [this message]
2014-10-27  1:15 ` [PATCH v3 1/2] t7800-difftool: use "test_must_fail grep" instead of "! grep" David Aguilar
2014-10-27  1:15   ` [PATCH v3 2/2] difftool: add support for --trust-exit-code David Aguilar
2014-10-27 18:45     ` Junio C Hamano
2014-10-28  9:34       ` David Aguilar

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

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

  git send-email \
    --in-reply-to=xmqqa94hfm60.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=davvid@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=j6t@kdbg$(echo .)org \
    --cc=sitaramc@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox