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.
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-20186-1540478683-828.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1868
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.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-20186-1540478683-828.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-20186-1540478683-828.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-29879-1540480352-325.127449-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 103
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
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-20186-1540478683-828.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-20186-1540478683-828.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-7262-1552089564-15.127449-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1822
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.