Skip to content

Commit 69b89a0

Browse files
jmdhjkeenan
authored andcommitted
Fix edge case test failure in ext/POSIX/t/mb.t
This new test fails in an environment where LANG is set to one thing and LC_ALL is set to another, and where LANG is set to a locale which is not installed in the environment in question. Such a test environment is arguably broken, but appears in common chroot setups such as Debian's sbuild tool where LANG is inherited from the parent environment, and LC_ALL is used to override it. Committer: removed one non-printing character from patch For: RT # 134182
1 parent fb55ce6 commit 69b89a0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ext/POSIX/t/mb.t

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ SKIP: {
3434
my $utf8_locale = find_utf8_ctype_locale();
3535
skip("no utf8 locale available", 3) unless $utf8_locale;
3636

37+
# Here we need to influence LC_CTYPE, but it's not enough to just
38+
# set this because LC_ALL could override it. It's also not enough
39+
# to delete LC_ALL because it could be used to override other
40+
# variables such as LANG in the underlying test environment.
41+
# Continue to set LC_CTYPE just in case...
3742
local $ENV{LC_CTYPE} = $utf8_locale;
38-
local $ENV{LC_ALL};
39-
delete $ENV{LC_ALL};
43+
local $ENV{LC_ALL} = $utf8_locale;
4044

4145
fresh_perl_like(
4246
'use POSIX; print &POSIX::MB_CUR_MAX',

0 commit comments

Comments
 (0)