1- use 5.006;
21use strict;
32use warnings;
43
5- # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058
4+ # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.059
65
76use Test::More;
87
@@ -66,7 +65,7 @@ for my $lib (@module_files)
6665 # see L<perlfaq8/How can I capture STDERR from an external command?>
6766 my $stderr = IO::Handle-> new;
6867
69- diag(' Running: ' , join (' , ' , map { my $str = $_ ; $str =~ s / '/ \\ '/ g ; q{ '} . $str . q{ '} }
68+ diag(' Running: ' , join (' , ' , map { my $str = $_ ; $str =~ s / '/ \\ '/ g ; q{ '} . $str . q{ '} }
7069 $^X, @switches , ' -e' , " require q[$lib ]" ))
7170 if $ENV {PERL_COMPILE_TEST_DEBUG };
7271
@@ -91,15 +90,15 @@ foreach my $file (@scripts)
9190 open my $fh , ' <' , $file or warn (" Unable to open $file : $! " ), next ;
9291 my $line = <$fh >;
9392
94- close $fh and skip(" $file isn't perl" , 1) unless $line =~ / ^#!\s *(?:\S *perl\S *)((?:\s +-\w *)*)(?:\s *#.*)?$ / ;
93+ close $fh and skip(" $file isn't perl" , 1) unless $line =~ / ^#!\s *(?:\S *(?:env )? perl\S *)((?:\s +-\w *)*)(?:\s *#.*)?$ / ;
9594 @switches = (@switches , split (' ' , $1 )) if $1 ;
9695
9796 close $fh and skip(" $file uses -T; not testable with PERL5LIB" , 1)
98- if grep { $_ eq ' -T' } @switches and $ENV {PERL5LIB };
97+ if grep $_ eq ' -T' , @switches and $ENV {PERL5LIB };
9998
10099 my $stderr = IO::Handle-> new;
101100
102- diag(' Running: ' , join (' , ' , map { my $str = $_ ; $str =~ s / '/ \\ '/ g ; q{ '} . $str . q{ '} }
101+ diag(' Running: ' , join (' , ' , map { my $str = $_ ; $str =~ s / '/ \\ '/ g ; q{ '} . $str . q{ '} }
103102 $^X, @switches , ' -c' , $file ))
104103 if $ENV {PERL_COMPILE_TEST_DEBUG };
105104
@@ -113,7 +112,7 @@ foreach my $file (@scripts)
113112 and not eval { +require blib; blib-> VERSION(' 1.01' ) };
114113
115114 # in older perls, -c output is simply the file portion of the path being tested
116- if (@_warnings = grep { !/\bsyntax OK$/ }
115+ if (@_warnings = grep !/\bsyntax OK$/ ,
117116 grep { chomp ; $_ ne (File::Spec-> splitpath($file ))[2] } @_warnings)
118117 {
119118 warn @_warnings;
@@ -123,7 +122,6 @@ foreach my $file (@scripts)
123122
124123
125124
126- is(scalar (@warnings ), 0, ' no warnings found' )
127- or diag ' got warnings: ' , ( Test::More-> can(' explain' ) ? Test::More::explain(\@warnings ) : join (" \n " , ' ' , @warnings ) ) if $ENV {AUTHOR_TESTING };
125+ is(scalar (@warnings ), 0, ' no warnings found' ) or diag ' got warnings: ' , ( Test::More-> can(' explain' ) ? Test::More::explain(\@warnings ) : join (" \n " , ' ' , @warnings ) ) if $ENV {AUTHOR_TESTING };
128126
129127
0 commit comments