From: Jeff King <peff@peff.net>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] t6300-for-each-ref: fix "more than one quoting style" tests
Date: Tue, 13 Feb 2018 17:22:47 -0500 [thread overview]
Message-ID: <20180213222247.GA18401@sigill.intra.peff.net> (raw)
In-Reply-To: <20180213003601.7396-1-szeder.dev@gmail.com>
On Tue, Feb 13, 2018 at 01:36:01AM +0100, SZEDER Gábor wrote:
> 'git for-each-ref' should error out when invoked with more than one
> quoting style options. The tests checking this have two issues:
>
> - They run 'git for-each-ref' upstream of a pipe, hiding its exit
> code, thus don't actually checking that 'git for-each-ref' exits
> with error code.
>
> - They check the error message in a rather roundabout way.
>
> Ensure that 'git for-each-ref' exits with an error code using the
> 'test_must_fail' helper function, and check its error message by
> grepping its saved standard error.
Yeah, this looks much nicer than the original.
> for i in "--perl --shell" "-s --python" "--python --tcl" "--tcl --perl"; do
> test_expect_success "more than one quoting style: $i" "
> - git for-each-ref $i 2>&1 | (read line &&
> - case \$line in
> - \"error: more than one quoting style\"*) : happy;;
> - *) false
> - esac)
> + test_must_fail git for-each-ref $i 2>err &&
> + grep '^error: more than one quoting style' err
I suspect in the long run this ought to be test_i18ngrep, but since it's
not localized yet, it makes sense to stop here with this patch.
-Peff
next prev parent reply other threads:[~2018-02-13 22:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-13 0:36 [PATCH] t6300-for-each-ref: fix "more than one quoting style" tests SZEDER Gábor
2018-02-13 22:22 ` Jeff King [this message]
2018-02-15 16:39 ` SZEDER Gábor
2018-02-15 16:52 ` Jeff King
2018-02-15 17:41 ` SZEDER Gábor
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=20180213222247.GA18401@sigill.intra.peff.net \
--to=peff@peff.net \
--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).