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
UTF-8 bug in Test::More and/or Test::Builder #11912
Comments
From tchrist@perl.comAs far as I can tell, it is not possible to reliably use Test::More's The problem is that Test::Builder::_new_fh() doesn't set to the encoding on Here are the four possibilities: -C0 -CS The only way to make it work is to run *without* a test harness and with -CS However, none of that works when run under a test harness. That means Here's the simple demo test program: use utf8; use Test::More; ## Uncomment this to learn where the real problem is happening: my $sisyphus = "© 2011, Σίσυφος"; diag("…starting Sisyphean tests"); like $sisyphus, qr/\N{COPYRIGHT SIGN}/, "it’s got a copyright sign"; diag("¿Qué pasó?"); done_testing(); This one screws up, and also produces illegal UTF-8: $ perl -C0 /tmp/badenc.t This is the only one that works: $ perl -CS /tmp/badenc.t This one also screws up: $ perl -C0 -MTest::Harness -e 'runtests(@ARGV)' /tmp/badenc.t /tmp/badenc.t .. Wide character in print at /usr/local/lib/perl5/5.14.0/Test/Builder.pm line 1759. And this doesn't help it at all -- notice the double encoding: $ perl -CS -MTest::Harness -e 'runtests(@ARGV)' /tmp/badenc.t --tom Summary of my perl5 (revision 5 version 14 subversion 0) configuration: Characteristics of this binary (from libperl): |
From @HugmeirOn Fri, Jan 27, 2012 at 11:16 AM, tchrist1 <perlbug-followup@perl.org>wrote:
http://www.effectiveperlprogramming.com/blog/1226 |
The RT System itself - Status changed from 'new' to 'open' |
From tchrist@perl.comIt gets even worse if you swap the like()s to unlike()s, --tom |
From tchrist@perl.com"Brian Fraser via RT" <perlbug-followup@perl.org> wrote
That just moves the bug/error around a bit. Now it seems to be in MakeMaker. use utf8; use open qw(:std :utf8); use Test::More; for my $meth ( qw(output failure_output) ) { ## Uncomment this to learn where the real problem is happening: my $sisyphus = "© 2011, Σίσυφος"; diag("…starting Sisyphean tests"); unlike $sisyphus, qr/\N{COPYRIGHT SIGN}/, "it’s got a copyright sign"; diag("¿Qué pasó?"); done_testing(); Which gives us: $ perl -CS -MTest::Harness -e 'runtests(@ARGV)' /tmp/badenc.t # Failed test 'græcum est: non potest legi' Test Summary Report If -C0 is required and expected, it should not be left up to the user to forget. You can argue that the default Makefile test target should add -C0 to its I'm running with PERL_UNICODE=SA. --tom |
From zefram@fysh.orgTest::More and Test::Builder are maintained as part of the Test-Simple -zefram |
From @xsawyerxOn Tue, 12 Dec 2017 03:20:52 -0800, zefram@fysh.org wrote:
Created: Test-More/test-more#802. I'm making "Rejected" to reflect it is rejected from this queue, but it now exists in the GH issue tracker for Test::More as the link above. |
@xsawyerx - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#109204 (status was 'rejected')
Searchable as RT109204$
The text was updated successfully, but these errors were encountered: