Skip Menu |
 

This queue is for tickets about the Test2-Plugin-NoWarnings CPAN distribution.

Report information
The Basics
Id: 129294
Status: resolved
Priority: 0/
Queue: Test2-Plugin-NoWarnings

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

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



Subject: test failure on Windows
Download (untitled) / with headers
text/plain 622b
In t/tap-bug-in-test2.t: # Seeded srand with seed '20190423' from local date. not ok 1 - warning event in subtest appears in TAP output # Failed test 'warning event in subtest appears in TAP output' # at t/tap-bug-in-test2.t line 33. # +-----+----+----------------------------------------------------+ # | GOT | OP | CHECK | # +-----+----+----------------------------------------------------+ # | | =~ | (?^:not\ ok\ 2\ \-\ Unexpected\ warning\:\ eek .+) | # +-----+----+----------------------------------------------------+ 1..1 -- Alexandr Ciornii, http://chorny.net
Download (untitled) / with headers
text/plain 901b
On 2019-04-23 13:22:17, CHORNY wrote: Show quoted text
> In t/tap-bug-in-test2.t: > > # Seeded srand with seed '20190423' from local date. > not ok 1 - warning event in subtest appears in TAP output > # Failed test 'warning event in subtest appears in TAP output' > # at t/tap-bug-in-test2.t line 33. > # +-----+----+----------------------------------------------------+ > # | GOT | OP | CHECK | > # +-----+----+----------------------------------------------------+ > # | | =~ | (?^:not\ ok\ 2\ \-\ Unexpected\ warning\:\ eek .+) | > # +-----+----+----------------------------------------------------+ > 1..1 > >
Thanks for the report. I saw that on CPANTesters. I think what's happening is that Capture::Tiny + system() isn't working as I expect on Windows for some reason, so there's no output to test. If you have any thoughts on this I'd be happy to hear them.
Download (untitled) / with headers
text/plain 825b
Windows 10, Strawberry Perl 5.26 -- I tried running the system() call alone, without the capture, and it gave me a syntax error in line 1. If I wrap the entire Perl program (here document) in ", and escape the " inside it, it appears to work: my $output = capture { # We expect this to exit non-zero since the test will fail. ## no critic (InputOutput::RequireCheckedSyscalls) system( $^X, '-e', <<'EOF' ); "use strict; use warnings; use Test2::V0; use Test2::Plugin::NoWarnings; ok(1); subtest 'subt' => sub { ok(1); warn \"eek\"; ok(2); }; done_testing();" EOF I think it has to do with system() not being fed a proper string (maybe?). Anyway, it passes with that change, so perhaps that will give you a clue as to a fix. I have no idea if adding " like that will break non-Windows systems.
Download (untitled) / with headers
text/plain 580b
Just to confirm, my June fix above works when I get a copy of the installation package, change the one .t file per above (wrap in double quotes and escape existing double quotes), and "cpan ." in that directory. That could be a workaround for other Windows users. I'll have to leave it to someone else to see whether or not this change breaks Linux and other non-Windows systems. If it does, the offending code could be compared to other .t files to see why it doesn't form a correct string in Windows. For the time being, I'm set (unless it's not fixed in the next CPAN release).
This should be fixed in 0.08.


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.