diff options
author | Tony Cook <tony@develop-help.com> | 2020-10-29 15:59:16 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2020-10-29 15:59:16 +1100 |
commit | fb072d007726c7ba114978a00f8f4f687ad7a55a (patch) | |
tree | 7900539979da1d88eca55303850d6f646de27d61 /t/run | |
parent | dfee93524089fd4fa372ce7e0dd15e2809b5c540 (diff) | |
download | perl-fb072d007726c7ba114978a00f8f4f687ad7a55a.tar.gz |
remove assertion that collation magic has data
This broke on some smokers where the locale collation data was
broken in some way (and rejected by the collation setup code.)
It also broke if collation magic was generated for an SV and then
the SV was modified, freeing the collation data before the SV was
destroyed.
Diffstat (limited to 't/run')
-rw-r--r-- | t/run/locale.t | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/t/run/locale.t b/t/run/locale.t index 78cfc2ff72..e072b63b0f 100644 --- a/t/run/locale.t +++ b/t/run/locale.t @@ -510,4 +510,29 @@ EOF } +SKIP: +{ + use locale; + # look for an english locale (so a < B, hopefully) + my ($en) = grep /^en_/, @locales; + POSIX::setlocale(LC_COLLATE, $en); + unless ("a" lt "B") { + skip "didn't find a suitable locale", 1; + } + fresh_perl_is(<<'EOF', "ok\n", { args => [ $en ] }, "check for failed assertion"); +use locale ':collate'; +use POSIX qw(setlocale LC_COLLATE); +if (setlocale(LC_COLLATE, shift)) { + my $x = "a"; + my $y = "B"; + print $x lt $y ? "ok\n" : "not ok\n"; + $x = "c"; # should empty the collxfrm magic but not remove it + # which the free code asserts on +} +else { + print "ok\n"; +} +EOF +} + done_testing(); |