Branch: refs/heads/blead
Home: https://github.com/Perl/perl5
Commit: 0ecf62fbe52bddbb4e0a881c6ea1cadf88cc1f5c
https://github.com/Perl/perl5/commit/0ecf62fbe52bddbb4e0a881c6ea1cadf88cc1f5c
Author: Karl Williamson <[email protected]>
Date: 2023-12-12 (Tue, 12 Dec 2023)
Changed paths:
M lib/locale.t
Log Message:
-----------
lib/locale.t: Properly handle setlocale() failure
This test file looks at all the locales on the system and tests for
basic sanity. If switching into a particular locale fails, its name is
added to a list of such, and the individual tests for it are skipped.
Failures for those are kept in a bunch of other lists, one for each type
of failure.
At the end the lists are supposed to be output. However, prior to this
commit, the setlocale failure list did not get output, but instead
triggered messages that each of the other failure types had occurred.
But if a failure type is empty, no list of locales for it would be
output. That is, the header for the failure was output with no content
as to which locales failed. If no failures besides the setlocale one
actually happen, you would get a series of these headers. Unless you
were familiar with the normal output of this .t, you would think there
are a bunch of unspecified failures, when in fact there were only the
setlocale ones.
This commit changes the test to output any setlocale failure list, and
to not have one trigger the output of the headers for the other failure
types.
This is a longstanding bug, unnoticed because it is rare for us to have
a locale we can't actually set to.