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.
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.
I have proposed this PR, which will resolve this issue: https://github.com/larryl/Test-PerlTidy/pull/3
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.