Re: [PATCH 2/2] Add C_LOCALE_OUTPUT prereq to test cases that require English text matching
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Jun 25, 2012, 11:32 UTC
- Message-ID
- <CACsJy8DpOL+V=sVZt3B-7OQ=POHtu1bovFB-sQ9HwPpmdKmN-A@mail.gmail.com>
- In-Reply-To
- <20120624162807.GB18791@burratino>
On Sun, Jun 24, 2012 at 11:28 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 10 quoted lines
> Nguyễn Thái Ngọc Duy wrote: > >> This fixes all GETTEXT_POISON breakages caused by recent i18n changes. > > First, thanks much for this. > > Lots of these could be fixed in a more targetted way by using > test_i18ngrep, but the C_LOCALE_OUTPUT prereq works just as well as a > way to double-check that the newly translated strings are hopefully > not disrupting any functionality people rely on.
I probably still don't grasp the principles behind gettext-poison. Pretending success quietly in test_i18ngrep and test_i18ncmp makes me uncomfortable. At least C_LOCAL_OUTPUT clearly shows the test is skipped, which is why I prefer it over test_i18n*. Letting it run to catch crashes is good, but not enough (it's more likely to crash with wrong printf format specifiers for example, which gettext-poison won't catch). Will update it according to your comments.
Show 16 quoted lines
> [...]
>> --- a/t/t0006-date.sh
>> +++ b/t/t0006-date.sh
>> @@ -9,7 +9,7 @@ TEST_DATE_NOW=1251660000; export TEST_DATE_NOW
>> check_show() {
>> t=$(($TEST_DATE_NOW - $1))
>> echo "$t -> $2" >expect
>> - test_expect_${3:-success} "relative date ($2)" "
>> + test_expect_${3:-success} C_LOCALE_OUTPUT "relative date ($2)" "
>> test-date show $t >actual &&
>> test_cmp expect actual
>> "
>
> Could use test_i18ncmp so we catch if test-date crashes, but anyway,
> yeah, we can't expect to be able to meaningfully test date formatting
> in another language.This reminds me of an inkscape crash I encountered long ago because of a mistake in Vietnamese translation. Too bad we can't test all locales for similar bugs (or we would need to i18n-ize expected results in the test suite too)
-- Duy