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.