Re: [PATCH 12/15] gettext tests: don't ignore "test-tool regex" exit code
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 3, 2022, 20:58 UTC
- Message-ID
- <xmqqsfryah42.fsf@gitster.g>
- In-Reply-To
- <220303.86zgm72g3j.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 27 quoted lines
> On Wed, Mar 02 2022, Junio C Hamano wrote: > >> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes: >> >>> -test_have_prereq GETTEXT_LOCALE && >>> -test-tool regex "HALLÓ" "Halló" ICASE && >>> -test_set_prereq REGEX_LOCALE >>> +test_expect_success GETTEXT_LOCALE 'setup REGEX_LOCALE prerequisite' ' >>> + if test-tool regex "HALLÓ" "Halló" ICASE >>> + then >>> + test_set_prereq REGEX_LOCALE >> >> This looks sensible but >> >>> + else >>> + test_must_fail test-tool regex "HALLÓ" "Halló" ICASE >> >> this side looks puzzling. I think this way to avoid counting abort >> etc as passing "must fail" test would be the least bad that we can >> do. >> >> Nicely done. > > Thanks. For the purposes of a re-roll I'll note this as a "nothing to > change", since the commit message explains why we're doing this, unless > you have comments on that explanation (the last paragraph of the commit > message).
The comment was mostly if it is more appropriate to explain the puzzling code with an in-code comment, rather than the log message.
In-code comment is for those who may find the current code strange. The log message is for those who wonder why the current code came to be in today's shape.