Skip Menu |

This queue is for tickets about the Test-Trap CPAN distribution.

Report information
The Basics
Id: 102271
Status: resolved
Priority: 0/
Queue: Test-Trap

People
Owner: ebhanssen [...] allverden.no
Requestors: cjm [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: v0.3.0
Fixed in: v0.3.0.0_1



Subject: Tests fail with LANG=en_US.UTF-8
I encountered test failures when trying to install Test-Trap v0.3.0 on Perl 5.20.1. The failed portion of the tests is: t/15-tempfile-options.t ........... 1/30 # Failed test 'TempFile 'preserve' strategy doesn't handle l stroke' # at t/15-tempfile-options.t line 44. # got: 'Å' # expected: 'ÃÂ' # Failed test ' (and warns)' # at t/15-tempfile-options.t line 45. # '' # doesn't match '(?^:^Wide character in print.*$)' # Looks like you failed 2 tests of 30. t/15-tempfile-options.t ........... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/30 subtests t/16-systemsafe-options.t ......... 1/30 # Failed test 'SystemSafe 'preserve' strategy doesn't handle l stroke' # at t/16-systemsafe-options.t line 44. # got: 'Å' # expected: 'ÃÂ' # Failed test ' (and warns)' # at t/16-systemsafe-options.t line 45. # '' # doesn't match '(?^:^Wide character in print.*$)' # Looks like you failed 2 tests of 30. t/16-systemsafe-options.t ......... Dubious, test returned 2 (wstat 512, 0x200) Failed 2/30 subtests Test Summary Report ------------------- t/15-tempfile-options.t (Wstat: 512 Tests: 30 Failed: 2) Failed tests: 3-4 Non-zero exit status: 2 t/16-systemsafe-options.t (Wstat: 512 Tests: 30 Failed: 2) Failed tests: 3-4 Non-zero exit status: 2 After some experimentation, I was able to determine that all tests pass if I set LANG=C when running them. Normally, my LANG is set to "en_US.UTF-8". I also have PERL_UNICODE=SAL, but that seems to be irrelevant (unsetting it doesn't make the tests pass). I got the same results with Perl 5.20.1, 5.18.1, & 5.18.2, all running on Gentoo Linux. I've attached the result of running these commands: perl -T -Mblib t/15-tempfile-options.t &>test-output.txt perl -T -Mblib t/16-systemsafe-options.t &>>test-output.txt
Subject: test-output.txt
1..30 ok 1 - TempFile 'basic' strategy doesn't handle l stroke ok 2 - (and warns) not ok 3 - TempFile 'preserve' strategy doesn't handle l stroke # Failed test 'TempFile 'preserve' strategy doesn't handle l stroke' # at t/15-tempfile-options.t line 44. # got: 'ł' # expected: 'ł' not ok 4 - (and warns) # Failed test ' (and warns)' # at t/15-tempfile-options.t line 45. # '' # doesn't match '(?^:^Wide character in print.*$)' ok 5 - TempFile 'utf8' strategy handles l stroke ok 6 - (no warning) ok 7 - TempFile 'both' strategy handles l stroke ok 8 - (no warning) ok 9 - TempFile 'latin2' strategy handles l stroke ok 10 - (no warning) ok 11 - TempFile 'basic' strategy doesn't handle pi ok 12 - (and warns) ok 13 - TempFile 'preserve' strategy handles pi ok 14 - (no warning) ok 15 - TempFile 'utf8' strategy handles pi ok 16 - (no warning) ok 17 - TempFile 'both' strategy handles pi ok 18 - (no warning) ok 19 - TempFile 'latin2' strategy doesn't handle pi; falls back to \x notation ok 20 - (and warns) ok 21 - TempFile 'basic' strategy doesn't handle per mille ok 22 - (and warns) ok 23 - TempFile 'preserve' strategy doesn't handle per mille; falls back to \x notation ok 24 - (and warns) ok 25 - TempFile 'utf8' strategy handles per mille ok 26 - (no warning) ok 27 - TempFile 'both' strategy doesn't handle per mille; falls back to \x notation ok 28 - (and warns) ok 29 - TempFile 'latin2' strategy doesn't handle per mille; falls back to \x notation ok 30 - (and warns) # Looks like you failed 2 tests of 30. 1..30 ok 1 - SystemSafe 'basic' strategy doesn't handle l stroke ok 2 - (and warns) not ok 3 - SystemSafe 'preserve' strategy doesn't handle l stroke # Failed test 'SystemSafe 'preserve' strategy doesn't handle l stroke' # at t/16-systemsafe-options.t line 44. # got: 'ł' # expected: 'ł' not ok 4 - (and warns) # Failed test ' (and warns)' # at t/16-systemsafe-options.t line 45. # '' # doesn't match '(?^:^Wide character in print.*$)' ok 5 - SystemSafe 'utf8' strategy handles l stroke ok 6 - (no warning) ok 7 - SystemSafe 'both' strategy handles l stroke ok 8 - (no warning) ok 9 - SystemSafe 'latin2' strategy handles l stroke ok 10 - (no warning) ok 11 - SystemSafe 'basic' strategy doesn't handle pi ok 12 - (and warns) ok 13 - SystemSafe 'preserve' strategy handles pi ok 14 - (no warning) ok 15 - SystemSafe 'utf8' strategy handles pi ok 16 - (no warning) ok 17 - SystemSafe 'both' strategy handles pi ok 18 - (no warning) ok 19 - SystemSafe 'latin2' strategy doesn't handle pi; falls back to \x notation ok 20 - (and warns) ok 21 - SystemSafe 'basic' strategy doesn't handle per mille ok 22 - (and warns) ok 23 - SystemSafe 'preserve' strategy doesn't handle per mille; falls back to \x notation ok 24 - (and warns) ok 25 - SystemSafe 'utf8' strategy handles per mille ok 26 - (no warning) ok 27 - SystemSafe 'both' strategy doesn't handle per mille; falls back to \x notation ok 28 - (and warns) ok 29 - SystemSafe 'latin2' strategy doesn't handle per mille; falls back to \x notation ok 30 - (and warns) # Looks like you failed 2 tests of 30.
Subject: Re: [rt.cpan.org #102271] Tests fail with LANG=en_US.UTF-8
Date: Sat, 21 Feb 2015 22:42:11 +0100
To: bug-Test-Trap [...] rt.cpan.org
From: Eirik Berg Hanssen <ebhanssen [...] cpan.org>
On Sat, Feb 21, 2015 at 9:58 PM, Christopher J. Madsen via RT < bug-Test-Trap@rt.cpan.org> wrote: Show quoted text
> > After some experimentation, I was able to determine that all tests pass if > I set LANG=C when running them. Normally, my LANG is set to > "en_US.UTF-8". I also have PERL_UNICODE=SAL, but that seems to be > irrelevant (unsetting it doesn't make the tests pass).
Thank you. I am also normally using LANG=en_US.utf8, so that's not it. But if I export PERL_UNICODE, I get the same failure, as long as it's set to anything, even the empty string. I can get it to work again, using C<< unset PERL_UNICODE >> or C<< export -n PERL_UNICODE >>. If you're using bash (or know how to get the same effect in whatever shell you use), can I ask you to try those two, and tell me if it actually fails after either of those? Meanwhile I'll be reading up on PERL_UNICODE, and trying to figure out why its presence, even when empty, breaks these tests for me ... Eirik
Sorry, you're quite right. I was setting PERL_UNICODE to the empty string, not unsetting it. With LANG=en_US.UTF-8, "unset PERL_UNICODE ; make test" passes but "PERL_UNICODE= make test" fails as described. PERL_UNICODE is described in perlrun under "-C": -C on its own (not followed by any number or option list), or the empty string "" for the PERL_UNICODE environment variable, has the same effect as -CSDL. In other words, the standard I/O handles and the default open() layer are UTF-8-fied but only if the locale environment variables indicate a UTF-8 locale. I had not realized the meaning of "PERL_UNICODE= " before I just looked it up. So I should have been trying "PERL_UNICODE=0 make test", and that does in fact pass all tests.
Subject: Re: [rt.cpan.org #102271] Tests fail with LANG=en_US.UTF-8
Date: Sat, 21 Feb 2015 23:44:21 +0100
To: bug-Test-Trap [...] rt.cpan.org
From: Eirik Berg Hanssen <ebhanssen [...] cpan.org>
On Sat, Feb 21, 2015 at 10:42 PM, ebhanssen via RT < bug-Test-Trap@rt.cpan.org> wrote: Show quoted text
> Meanwhile I'll be reading up on PERL_UNICODE, and trying to figure out > why its presence, even when empty, breaks these tests for me ... >
Okay, I see why. And PERL5OPT="-C" breaks it the same way, of course. Actually makes me wonder why those environment variables aren't ignored in taint mode, like PERLIO is ... But I guess I should just stop assuming the STDOUT is opened without utf8, and rather check if it is ... Done in v0.3.0.0_1 – along with some other test cleanup I had pending – and uploaded to PAUSE. If the CPAN Testers don't show anything bad, I imagine this will be v0.3.1 in a day or two. Thanks again. :) Eirik
And I've uploaded non-dev release v0.3.1 to PAUSE, including this fix. Thanks!