Skip Menu |
 

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

Report information
The Basics
Id: 127449
Status: resolved
Priority: 0/
Queue: Test-PerlTidy

People
Owner: Nobody in particular
Requestors: PLICEASE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Doesn't handle UTF-8 correctly.
Download (untitled) / with headers
text/plain 1.8k
Consider this test file with an intentionally untidy line and some unicode in it: twin% more t/not_tidy.t use utf8; use strict; # 火雞 use warnings; use Test::More; ok 1; done_testing; this is displayed incorrectly by Test::PerlTidy: # The file 't/not_tidy.t' is not tidy # +--+------------------------------------------+-------------------------------------------+ # | 1|use utf8; |use utf8; | # * 2|use strict; # \xe7\x81\xab\xe9\x9b\x9e |use strict; # \xe7\x81\xab\xe9\x9b\x9e * # | 3|use warnings; |use warnings; | # | 4|use Test::More; |use Test::More; | # | 5| | | # +--+------------------------------------------+-------------------------------------------+ not ok 8 - 't/not_tidy.t' # Failed test ''t/not_tidy.t'' # at t/perltidy.t line 11. The correct output should look something like this: # The file 't/not_tidy.t' is not tidy # +--+----------------------------------+-----------------------------------+ # | 1|use utf8; |use utf8; | # * 2|use strict; # \x{706b}\x{96de} |use strict; # \x{706b}\x{96de} * # | 3|use warnings; |use warnings; | # | 4|use Test::More; |use Test::More; | # | 5| | | # +--+----------------------------------+-----------------------------------+ not ok 8 - 't/not_tidy.t' # Failed test ''t/not_tidy.t'' # at t/perltidy.t line 11. It would be even better to display the actual characters itself, though this may not be possible with Text::Diff.
Download (untitled) / with headers
text/plain 103b
I have proposed this PR, which will resolve this issue: https://github.com/larryl/Test-PerlTidy/pull/3
Download (untitled) / with headers
text/plain 1.7k
On Thu Oct 25 10:44:43 2018, PLICEASE wrote: Show quoted text
> Consider this test file with an intentionally untidy line and some > unicode in it:
pull req merged. Show quoted text
> > twin% more t/not_tidy.t > use utf8; > use strict; # 火雞 > use warnings; > use Test::More; > > ok 1; > > done_testing; > > this is displayed incorrectly by Test::PerlTidy: > > # The file 't/not_tidy.t' is not tidy > # +--+------------------------------------------ > +-------------------------------------------+ > # | 1|use utf8; |use utf8; > | > # * 2|use strict; # \xe7\x81\xab\xe9\x9b\x9e |use strict; # > \xe7\x81\xab\xe9\x9b\x9e * > # | 3|use warnings; |use warnings; > | > # | 4|use Test::More; |use Test::More; > | > # | 5| | > | > # +--+------------------------------------------ > +-------------------------------------------+ > not ok 8 - 't/not_tidy.t' > # Failed test ''t/not_tidy.t'' > # at t/perltidy.t line 11. > > The correct output should look something like this: > > # The file 't/not_tidy.t' is not tidy > # +--+---------------------------------- > +-----------------------------------+ > # | 1|use utf8; |use utf8; > | > # * 2|use strict; # \x{706b}\x{96de} |use strict; # > \x{706b}\x{96de} * > # | 3|use warnings; |use warnings; > | > # | 4|use Test::More; |use Test::More; > | > # | 5| | > | > # +--+---------------------------------- > +-----------------------------------+ > not ok 8 - 't/not_tidy.t' > # Failed test ''t/not_tidy.t'' > # at t/perltidy.t line 11. > > It would be even better to display the actual characters itself, > though this may not be possible with Text::Diff.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.