@@ -32,15 +32,15 @@ local $IPC::Cmd::DEBUG = $Verbose;
3232
3333# ## run tests in various configurations, based on what modules we have
3434my @Prefs = ( );
35- push @Prefs , [ $Have_IPC_Run , $Have_IPC_Open3 ] if $Have_IPC_Run ;
35+ push @Prefs , [ $Have_IPC_Run , $Have_IPC_Open3 ] if $Have_IPC_Run ;
3636
3737# ## run this config twice to ensure FD restores work properly
38- push @Prefs , [ 0, $Have_IPC_Open3 ],
38+ push @Prefs , [ 0, $Have_IPC_Open3 ],
3939 [ 0, $Have_IPC_Open3 ] if $Have_IPC_Open3 ;
4040
4141# ## run this config twice to ensure FD restores work properly
4242# ## these are the system() tests;
43- push @Prefs , [ 0, 0 ], [ 0, 0 ];
43+ push @Prefs , [ 0, 0 ], [ 0, 0 ];
4444
4545
4646# ## can_run tests
@@ -49,7 +49,7 @@ push @Prefs, [ 0, 0 ], [ 0, 0 ];
4949 ok( !can_run(' 10283lkjfdalskfjaf' ), q[ Not found non-existent binary] );
5050}
5151
52- { # ## list of commands and regexes matching output
52+ { # ## list of commands and regexes matching output
5353 # ## XXX use " everywhere when using literal strings as commands for
5454 # ## portability, especially on win32
5555 my $map = [
@@ -61,7 +61,7 @@ push @Prefs, [ 0, 0 ], [ 0, 0 ];
6161
6262 # ## pipes
6363 [ " $^X -eprint+424 | $^X -neprint+split+2" , qr / 44/ , 3, ],
64- [ [$^X,qw[ -eprint+424 |] , $^X, qw| -neprint+split+2| ],
64+ [ [$^X,qw[ -eprint+424 |] , $^X, qw| -neprint+split+2| ],
6565 qr / 44/ , 3, ],
6666 # ## whitespace
6767 [ [$^X, ' -eprint+shift' , q| a b a| ], qr / a b a/ , 3, ],
@@ -80,16 +80,16 @@ push @Prefs, [ 0, 0 ], [ 0, 0 ];
8080
8181 # ## extended test in developer mode
8282 # ## test if gzip | tar works
83- if ( $Verbose ) {
83+ if ( $Verbose ) {
8484 my $gzip = can_run(' gzip' );
8585 my $tar = can_run(' tar' );
86-
86+
8787 if ( $gzip and $tar ) {
8888 push @$map ,
89- [ [$gzip , qw[ -cdf src/x.tgz |] , $tar , qw[ -tf -] ],
89+ [ [$gzip , qw[ -cdf src/x.tgz |] , $tar , qw[ -tf -] ],
9090 qr / a/ , 3, ];
9191 }
92- }
92+ }
9393
9494 # ## for each configuration
9595 for my $pref ( @Prefs ) {
@@ -109,27 +109,23 @@ push @Prefs, [ 0, 0 ], [ 0, 0 ];
109109 $pp_cmd .= " (IPC::Run: $pref ->[0] IPC::Open3: $pref ->[1])" ;
110110
111111 diag( " Running '$pp_cmd '" ) if $Verbose ;
112- sleep (0.3) if $^O eq ' MSWin32' ;
113- sleep (2) if $ENV {APPVEYOR };
114112
115113 # ## in scalar mode
116114 { my $buffer ;
117115 my $ok = run( command => $cmd , buffer => \$buffer );
118116
119117 ok( $ok , " Ran '$pp_cmd ' command successfully" );
120-
118+
121119 SKIP: {
122- skip " No buffers available" , 1
123- unless $Class -> can_capture_buffer;
124- skip " Appveyor failure" , 1
125- if $^O eq ' MSWin32' and $ENV {APPVEYOR } and $buffer !~ $regex ;
126-
127- like( $buffer , $regex ,
120+ skip " No buffers available" , 1
121+ unless $Class -> can_capture_buffer;
122+
123+ like( $buffer , $regex ,
128124 " Buffer matches $regex -- ($pp_cmd )" );
129125 }
130126 }
131-
132- # ## in list mode
127+
128+ # ## in list mode
133129 { diag( " Running list mode" ) if $Verbose ;
134130 my @list = run( command => $cmd );
135131
@@ -141,22 +137,17 @@ push @Prefs, [ 0, 0 ], [ 0, 0 ];
141137 " Output list has $list_length entries -- ($pp_cmd )" );
142138
143139 SKIP: {
144- skip " No buffers available" , 6
140+ skip " No buffers available" , 6
145141 unless $Class -> can_capture_buffer;
146-
142+
147143 # ## the last 3 entries from the RV, are they array refs?
148144 isa_ok( $list [$_ ], ' ARRAY' ) for 2..4;
149- # flapping tests on Appveyor CI (~20%)
150- if ($ENV {APPVEYOR } and " @{$list [2]}" !~ $regex ) {
151- ok(1, " SKIP empty pp_cmd APPVEYOR (too short sleep)" );
152- ok(1, " SKIP empty pp_cmd APPVEYOR" );
153- } else {
154- like( " @{$list [2]}" , $regex ,
145+
146+ like( " @{$list [2]}" , $regex ,
155147 " Combined buffer matches $regex -- ($pp_cmd )" );
156148
157- like( " @{$list [$index ]}" , qr /$regex / ,
158- " Proper buffer($index ) matches $regex -- ($pp_cmd )" );
159- }
149+ like( " @{$list [$index ]}" , qr /$regex / ,
150+ " Proper buffer($index ) matches $regex -- ($pp_cmd )" );
160151 is( scalar ( @{$list [ $index ==3 ? 4 : 3 ]} ), 0,
161152 " Other buffer empty -- ($pp_cmd )" );
162153 }
@@ -199,6 +190,7 @@ unless ( IPC::Cmd->can_use_run_forked ) {
199190 ok($out =~ m / err/ , " stderr handled" );
200191}
201192
193+
202194__END__
203195### special call to check that output is interleaved properly
204196{ my $cmd = [$^X, File::Spec->catfile( qw[src output.pl] ) ];
@@ -223,10 +215,10 @@ __END__
223215 is( "@{$list[2]}",'1 2 3 4'," Combined output as expected" );
224216 is( "@{$list[3]}", '1 3', " STDOUT as expected" );
225217 is( "@{$list[4]}", '2 4', " STDERR as expected" );
226-
218+
227219 }
228220 }
229- }
221+ }
230222}
231223
232224
@@ -244,7 +236,7 @@ __END__
244236 ok( !$ok, "Non-zero exit caught" );
245237 ok( $err, " Error '$err'" );
246238 }
247- }
239+ }
248240
249241### timeout tests
250242{ my $timeout = 1;
@@ -262,5 +254,5 @@ __END__
262254 ok( not(ref($err)), " Error string is not a reference" );
263255 like( $err,qr/^$AClass/," Error '$err' mentions $AClass" );
264256 }
265- }
257+ }
266258
0 commit comments