Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locale tests may fail (0.7.9) #4

Open
eserte opened this issue Nov 2, 2018 · 1 comment
Open

Locale tests may fail (0.7.9) #4

eserte opened this issue Nov 2, 2018 · 1 comment

Comments

@eserte
Copy link

eserte commented Nov 2, 2018

See http://matrix.cpantesters.org/?dist=Sort-Naturally-XS%200.7.9;os=linux;reports=1 for a list of fail reports --- it seems that all of the current linux fail reports are locale-related. Sorry, I don't have more information why it fails on some of my smokers.

@andk
Copy link

andk commented Jan 9, 2022

Thread-safe locale handling was introduced to perl in commit Perl/perl5@e9bc6d6b34, also known as v5.27.8-303-ge9bc6d6b34. Since then the test https://metacpan.org/release/SERVAL/Sort-Naturally-XS-0.7.9/source/t/Sort-Naturally-XS-sorted.t#L110 fails in threaded perls, iff the locale en_CA is installed.
I have patched my copy of the test to provide more diagnostics on the failing test. The pseudo-patch:

            my $ar_ca_local__expected = [qw/A a B b C c/];
            my $ar_ca_local__actual = sorted($ar_en_local, locale => $locale);
   -        ok(eq_array($ar_ca_local__expected, $ar_ca_local__actual), 'Locale CA test');
   +        ok(eq_array($ar_ca_local__expected, $ar_ca_local__actual), 'Locale CA test')
   +            or diag explain { actual => $ar_ca_local__actual, expected => $ar_ca_local__expected };
        }

This gives the following output:

   #   Failed test 'Locale CA test'
   #   at t/Sort-Naturally-XS-sorted.t line 110.
   # {
   #   'actual' => [
   #     'a',
   #     'A',
   #     'b',
   #     'B',
   #     'c',
   #     'C'
   #   ],
   #   'expected' => [
   #     'A',
   #     'a',
   #     'B',
   #     'b',
   #     'C',
   #     'c'
   #   ]
   # }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants