git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Stefan Beller <sbeller@google.com>
Cc: Lars Schneider <larsxschneider@gmail.com>,
	Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] t7406: fix i18n expectation of error message
Date: Fri, 5 May 2017 19:50:29 +0200	[thread overview]
Message-ID: <CACBZZX6ZzrJk77ReJ592rJrNR1xhVCQid6_5KTonwTot5eq-hQ@mail.gmail.com> (raw)
In-Reply-To: <20170505173841.20555-1-sbeller@google.com>

On Fri, May 5, 2017 at 7:38 PM, Stefan Beller <sbeller@google.com> wrote:
> The error message from "submodule update" is internationalized, which
> makes sense. The test however did not check for the translated version,
> but used a hardcoded string, which breaks the test when run with
> GETTEXT_POISON.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  t/t7406-submodule-update.sh | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
> index 4ac386d98b..12f6435ab0 100755
> --- a/t/t7406-submodule-update.sh
> +++ b/t/t7406-submodule-update.sh
> @@ -441,13 +441,11 @@ test_expect_success 'submodule update - command in .git/config catches failure -
>         test_i18ncmp actual expect
>  '
>
> +sq="'"
>  test_expect_success 'submodule update - command run for initial population of submodule' '
> -       cat >expect <<-EOF &&
> -       Execution of '\''false $submodulesha1'\'' failed in submodule path '\''submodule'\''
> -       EOF
>         rm -rf super/submodule &&
>         test_must_fail git -C super submodule update 2>actual &&
> -       test_cmp expect actual &&
> +       test_i18ngrep "Execution of ${sq}false $submodulesha1${sq} failed in submodule path ${sq}submodule${sq}" actual &&
>         git -C super submodule update --checkout
>  '

I have a fix for this in my gettext fixup series (so far lingering on
the list, not in pu):
https://public-inbox.org/git/20170421185757.28978-1-avarab@gmail.com/

The diff is quite a bit smaller than yours:

diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 4ac386d98b..034914a14f 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -447,7 +447,7 @@ test_expect_success 'submodule update - command
run for initial population of su
        EOF
        rm -rf super/submodule &&
        test_must_fail git -C super submodule update 2>actual &&
-       test_cmp expect actual &&
+       test_i18ncmp expect actual &&
        git -C super submodule update --checkout
 '

Do you prefer to use i18ngrep for whatever reason? Seems better to use
i18ncmp there.

  reply	other threads:[~2017-05-05 17:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 15:40 [PATCH v1 0/2] run GETTEXT_POISON on TravisCI Lars Schneider
2017-05-05 15:40 ` [PATCH v1 1/2] travis-ci: setup "prove cache" in "script" step Lars Schneider
2017-05-05 19:26   ` Ævar Arnfjörð Bjarmason
2017-05-05 15:40 ` [PATCH v1 2/2] travis-ci: add job to run tests with GETTEXT_POISON Lars Schneider
2017-05-05 16:08   ` Jonathan Nieder
2017-05-05 17:38 ` [PATCH] t7406: fix i18n expectation of error message Stefan Beller
2017-05-05 17:50   ` Ævar Arnfjörð Bjarmason [this message]
2017-05-05 17:53     ` Stefan Beller
2017-05-05 22:43     ` Johannes Sixt
2017-05-05 18:19 ` [PATCH v2] tests: fix tests broken under GETTEXT_POISON=YesPlease Ævar Arnfjörð Bjarmason
2017-05-08  2:02   ` 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=CACBZZX6ZzrJk77ReJ592rJrNR1xhVCQid6_5KTonwTot5eq-hQ@mail.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=larsxschneider@gmail.com \
    --cc=sbeller@google.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).