PƔdraig Brady <P@draigBrady.com> writes:
>> +# and that it uses it by default when no format string is given.
>> +for locale in $(locale -a); do
>> + export LC_ALL=$locale
>> + date -d '2025-10-11T13:00' +"$(locale date_fmt)" > $locale.exp || fail=1
>> + date -d '2025-10-11T13:00' > $locale.out || fail=1
>> + compare $locale.exp $locale.out || fail=1
>> +done
>
> It might be a little overkill?
>
> $ locale -a | wc -l 890
>
> Maybe `locale -a | shuf -n10`
It was fast on my system, at least.
It is also good at testing strftime because I don't think we have
coverage for the 'E' and 'O' flags.
But testing 10 locales should be enough, so that is fine with me.
> Also this outputs nothing:
> $ date -d '2025-10-11T13:00' +
>
> I.e. we'd want to verify that `locale date_fmt` actually returns something,
> as otherwise there would be a mismatch.
I would hope that is never the case. But the systems locales are out of
our control, so we can add that check.
I pushed the attached v2 patch, which also addresses Grisha's comments.
Thanks both for the review.
Collin